Orientation of Y axis in Technical Drawings?

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
mrlukeparry
Posts: 652
Joined: Fri Jul 22, 2011 8:37 pm
Contact:

Orientation of Y axis in Technical Drawings?

Postby mrlukeparry » Mon Jan 13, 2014 11:18 pm

Very quick question.

In Technical Drawings - such as Autocad (DWG) or LibreCAD is the origin located at the bottom left of the paper or the top left? Common sense would say the bottom left but would like this checking :)

In Qt the coordinate system is represented from the top left with the Y axis pointing downwards, so I need make sure I'm consisten with the drawing module I'm working on.

Cheers!
Luke
User avatar
NormandC
Posts: 12279
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Orientation of Y axis in Technical Drawings?

Postby NormandC » Tue Jan 14, 2014 2:36 am

Hi Luke,

Nice to see you back.

In all CAD software that I know of (that includes AutoCAD, LibreCAD/QCad, Solidworks, Solid Edge) the origin is located at the bottom left.

mrlukeparry wrote:In Qt the coordinate system is represented from the top left with the Y axis pointing downwards

Kind of it already is currently in the Drawing module. I can't speak for other but I find this unnatural. ;)
jmaustpc
Posts: 8101
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Orientation of Y axis in Technical Drawings?

Postby jmaustpc » Tue Jan 14, 2014 5:13 am

Hi Luke
The official standard for svg origin is the top left. Which is no doubt why Drawing WB has the top left. Although, Inskape's GUI seems to imply its the bottom left. So this must be the standard for how the origin is defined in file format, but it would seem not the application gui?

inkscape_GUI.png
inkscape_GUI.png (57.07 KiB) Viewed 1981 times



Libre CAD, as Norm said, is bottom left, in its GUI.

GCAD3D has its origin of its 3d model space in the centre of the view window.

Karbon, the KDE svg application has its gui origin at the top left.

Libre Office Draw has its GUI origin at the top left, like a word processor.
User avatar
NormandC
Posts: 12279
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Orientation of Y axis in Technical Drawings?

Postby NormandC » Tue Jan 14, 2014 5:35 am

jmaustpc wrote:GCAD3D has its origin of its 3d model space in the centre of the view window.

As is the case for all CAD software, including LibreCAD. Only in paper space is the origin at bottom left, if I remember correctly... The librecad-dev PPA precise package is currently broken, cannot check.

That vector graphics editors put it at the top has no relevancy here: CAD users expect it to be at the bottom, and this is where it should logically be, if at all possible.
User avatar
jriegel
Site Admin
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: Orientation of Y axis in Technical Drawings?

Postby jriegel » Tue Jan 14, 2014 10:38 am

Ahh, thats really interesting! Its true, in most paper based things you start from top to bottom. And a engineer mostly thinks from the ground up (bottom to top).

If we switch the "logical" coordinate system opposite to the natural SVG system we will face some problems. Every code, mostly python, would have to make this switch back and forth. And that will cause a lot of problems and frustrations. Technically easy, would be a kind of camera transformation (as we do it in 3D), but hard for the mind of voluntary programmers...

I tend neither way, but if we go to bottom to up, we would have to introduce some kind of transformation service which allow the programmer to go from paper/SVG space to logical drawing space and back.

The easiest (thats why I used it in the first implementation) would be to stay in SVG logic :). But FOSS project don't tend to go the easiest way :lol:
Stop whining - start coding!
User avatar
twohot
Posts: 35
Joined: Tue May 17, 2011 10:48 pm
Location: 9ja://coalcity
Contact:

Re: Orientation of Y axis in Technical Drawings?

Postby twohot » Tue Jan 14, 2014 11:47 am

If its "technical" drawings we speak of, then experience says its either at the centre of the screen or at the bottom-left corner. Through years of schooling (technical drawings), origins have been associated with Cartesian Plane Geometry. X is always horizontal and points right, while Y is vertical and points forward (plan view says "up"). Z is indicated as a "dot" where the X and Y axes meet (as point at the viewer).

Really, the position of the axes gizmo is irrelevant as the case is with AutoCAD. In Acad, it disappears or sits at the bottom left when the origin is out of the screen (which is sometimes misleading). What matters is that user is adequately informed of the active coordinate system (which usually changes in CAD/BIM applications, between local and global coordinate systems).

Statistics tend to favour bottom-left (both for the gizmo and the origin it represents). For that reason, I'd suggest we use that
User avatar
yorik
Site Admin
Posts: 8677
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: Orientation of Y axis in Technical Drawings?

Postby yorik » Tue Jan 14, 2014 1:04 pm

The idea behind svg being top-down is that it is originally a web format, made to "flow" together with html, which is naturally top-down too. In HTML5 nowadays you can do amazing stuff with mixing html and svg code...

My opinion is that svg coordinates are a "feature" of svg and we should not hide it... And that it is better that python coders are aware of it, and do the necessary transformations.

It might be interesting to offer some conversion tools in the Drawing module...
jmaustpc
Posts: 8101
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Orientation of Y axis in Technical Drawings?

Postby jmaustpc » Tue Jan 14, 2014 1:20 pm

Hi everyone
What I did for all the applications was open them up and push the mouse pointer around and look at the x y values to find the origin. Which reminds me, that’s how I determined that LibreCAD uses the bottom left not the centre, I am talking about its default modelling window, whatever that is called, am I missing the point? :?


@ Juergen and Yorik (and everyone else) :)
Did you notice what I said about Inskape having a different origin than the SVG standard, I thought that looked significant. Although svg origin is top left Inscape is using bottom left, so it must be converting somewhere. Could we use that somehow, look at their code, copy it, use the lib that inkscape talks to. Inskcape is a front end and a lib as far as I understand it. So I started reading the link below.

Actually if you look up the SVG standard it actually says that there are two things to consider firstly the "canvas" which is an infinite plane and then "SVG viewport", which is what we can think of as being in effect our paper size. However this is just the initial viewport, which has identical coordinates system with the canvas. You can then nest more viewports inside the initial and subsequent viewports. You then define a transform from one viewport to the viewport in which it is nested. The transforms of different types are available e.g. lineal, skew, rotate.

http://www.w3.org/TR/SVG11/coords.html

from the link above

Using the above information, the SVG user agent determines the viewport, an initial viewport coordinate system and an initial user coordinate system such that the two coordinates systems are identical. Both coordinates systems are established such that the origin matches the origin of the viewport (for the root viewport, the viewport origin is at the top/left corner), and one unit in the initial coordinate system equals one "pixel" in the viewport. (See Initial coordinate system.) The viewport coordinate system is also called viewport space and the user coordinate system is also called user space.



this link takes to the specific paragraph on SVG viewport Transforms

http://www.w3.org/TR/SVG11/coords.html# ... wUserSpace

It seems to me that for our drawings we should be using the initial viewport for the paper size then nest another with a lineal transform to define the space for the boarder, then nest another viewport within the nested viewport with the appropriate transforms to flip our orientation of our coordinates system to that which we desire.

Having said all the above, I am only being a 5 minute expert after a quick read. But Inskape must be doing something like this because it is flipping its coordinates system in EXACTLY the manner that we want, based on what Norm said is normal for all those CAD applications he has experience with.

Jim
jmaustpc
Posts: 8101
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Orientation of Y axis in Technical Drawings?

Postby jmaustpc » Tue Jan 14, 2014 1:32 pm

Further more if DXF is origin bottom left in its file, as it is in its applications, this means we do not have to code much to flip the origin from this for SVG. We can just keep the origin the same for svg and dxf, and use the doubly nested viewport in SVG to transform the doubly nested viewports coordinates system to allow for the difference in the SVG standard.
User avatar
jriegel
Site Admin
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: Orientation of Y axis in Technical Drawings?

Postby jriegel » Tue Jan 14, 2014 1:35 pm

Where to place the origin is a decision we have to make. The only premises I would set are:

1) Usage of an right handed coordinate system (as everywhere in FreeCAD).
2) And using a clear length unit (e.g. mm or inch NOT px pixel). Where a CAD system after all....
Stop whining - start coding!