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.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
shoogen
Veteran
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: Orientation of Y axis in Technical Drawings?

Post by shoogen »

Jim, what inkscape does i pretty ugly. The cordinates in the GUI display don't match up with the coorindates in the XML editor.
jriegel wrote: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....
1. On a sheet of paper i can invert the z axis to make the CS right handed
2. This is pretty hard. Please, under no circumstaces use CSS (relative) units in SVG. There is a single way to set redefine the user units (px) (the viewBOX). Everything else is derived from this definition of px. Do nerver ever put a unit statement inside a SVG besides for giving the real word size of the viewBox. I wrote the unit handling for SVG importer for FreeCAD and had to implement the crappy unit handling. It's based on CSS, it is ment to preserve relations when scaling something on a screen.
Please als well do not nest <SVG> Tags. It's allowed, but will cascade all the transformations.
The other [than px] absolute unit identifiers from CSS (i.e., pt, pc, cm, mm, in) are all defined as an appropriate multiple of one px
IMHO using one big translate operation to flip the y axis is the right way to go.
User avatar
jriegel
Founder
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: Orientation of Y axis in Technical Drawings?

Post by jriegel »

AFAIK using mm is in the SVG standard and not CSS...
px are very dangerous. In theory the renderer (e.g. Windows system) has to calculate the px size from the monitor information, which can be quadratic but don't have to be. Just hopping the subsequent tool chain asume px=mm is a bit dengarouse! You have often the case in a technical drawing to measure a edge or a length without a datum. If we get fuzzy right from the start, a lot of problems lays ahead.
Stop whining - start coding!
User avatar
shoogen
Veteran
Posts: 2823
Joined: Thu Dec 01, 2011 5:24 pm

Re: Orientation of Y axis in Technical Drawings?

Post by shoogen »

jriegel wrote:AFAIK using mm is in the SVG standard and not CSS...
There are two ways to use units in SVG.
1. in the SVG tag to specify the real world size of the viewbox. (That the way to redife px to be something other than 90dpi)
2. putting a unit to an arbitray numerical value outside the SVG tag.
The latter use has a lot of problems.
The first problem is that you can't have units in the "d" attribute of a path element. you are forced to use px there.
if you supply such a unit postfilx, the value won't be interpreted as an aboulte value, but instead translated into a vlaue in user units (px). In this manner whenever you use in (outside the SVG tag) it will allways be treated as beeing 90px.
jriegel wrote:px are very dangerous.
Yes they are. Please file your complaints to the W3C. The background of SVG is to replace bitmap graphics.
jriegel wrote:In theory the renderer (e.g. Windows system) has to calculate the px size from the monitor information, which can be quadratic but don't have to be.
Having usefull information about the monitor resolution is not a problem of SVG but of the operating system. The aspect ratio problems are adressed in the SVG standartd. But since we don't want non-uniformscaling it doesn't apply to our usecase.
jriegel wrote:Just hopping the subsequent tool chain asume px=mm is a bit dengarouse!
we don't assume it we define it with the SVG tag with a vieBox attribute. It is the only way the standard allows us to do it.
https://github.com/5263/FreeCAD/commit/ ... a33bde6022
The only alternative is to omit the units in the SVG tag. This should make all the renderes fallback to 90dpi. But in this case a render might choose to map svg px to monitor pixel instead of a scaling to match the monitor real resolution.
jriegel wrote:You have often the case in a technical drawing to measure a edge or a length without a datum. If we get fuzzy right from the start, a lot of problems lays ahead.
We don't start form scratch we allready have SVG import and export functions in FreeCAD. Can you please specify in wich way you are unhappy with the unit handling.
http://freecadweb.org/wiki/index.php?ti ... t_Handling
viewtopic.php?f=8&t=2104&start=20
viewtopic.php?f=10&t=2226&start=10
User avatar
jriegel
Founder
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: Orientation of Y axis in Technical Drawings?

Post by jriegel »

Mhh, I'm not quit sure I understand it all.... but sounds reasonably :)
Stop whining - start coding!
danielfalck
Posts: 395
Joined: Fri Oct 07, 2011 8:58 pm
Location: Beaverton,Oregon, USA
Contact:

Re: Orientation of Y axis in Technical Drawings?

Post by danielfalck »

I vote for right hand rule. +Y needs to point up - as it does in all CAD systems.
j-dowsett
Posts: 210
Joined: Wed Sep 07, 2011 9:37 am

Re: Orientation of Y axis in Technical Drawings?

Post by j-dowsett »

danielfalck wrote:I vote for right hand rule. +Y needs to point up - as it does in all CAD systems.
Yep, I agree, X increasing rightwards, Y increasing upwards.
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Orientation of Y axis in Technical Drawings?

Post by yorik »

I render to the majority then :) This would also be a good opportunity to unify the Draft-to-Drawing and Drawing tools which currently work with "contrary" direction...

One related thing I've been scratching my head with since a little time, one of the most-asked questions we hear here is certainly "how do I put dimensions on my drawing?". It is already possible, draft dimensions work fairly well now, but the problem is obviously that you must use the Draft tool instead of the normal Drawing tool to place them on the drawing sheet, which is far from obvious. But we absolutely can't make the Drawing module depend on something from the Draft module. So what could be a good solution to that? Any idea?
User avatar
jriegel
Founder
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: Orientation of Y axis in Technical Drawings?

Post by jriegel »

Mhh, the clean (and big) solution would be to enable the drawing module with selection and associativity.

Selection mean you can select lines points and so on in the drawing view (SVG elements).

Associativity mean you can add a "DatumFeature" to a selected line and points. This feature knows the "names" of the 2D SVG element they belong to and can be updated after a regeneration of the drawing view ( if the elements still exists).

That was the original plan, never got the time to do it...

Quick and dirty we could add a additional menu to the drawing workbench with some proxy commands. This commands (only if activated) could load the draft module and offer the tools. Not a really good solution but making Drawing dependent on Draft is no good idea...
Stop whining - start coding!
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Orientation of Y axis in Technical Drawings?

Post by jmaustpc »

Whichever way we do it wouldn't it be a good idea to put a visual aid of some sort showing the axis direction?

Perhaps a 2d version of what you see in the 3d model window.
yorik wrote: It is already possible, draft dimensions work fairly well now, but the problem is obviously that you must use the Draft tool instead of the normal Drawing tool to place them on the drawing sheet, which is far from obvious. But we absolutely can't make the Drawing module depend on something from the Draft module. So what could be a good solution to that? Any idea?
How does it work with the other Draft object?

If nothing else, couldn't we have a warning pop up telling you to use the tool in Draft workbench if a "Draft Dimension" Drawing insert is attempted? Currently you get "wrong selection" - "Select a Part object.". So could the code, if its not a Part Object, then look and see if it is a Draft Dimension, and if so produce a more helpful message?
Attachments
draftdimensionerrorpopupdrawingwb.png
draftdimensionerrorpopupdrawingwb.png (136.15 KiB) Viewed 2924 times
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Orientation of Y axis in Technical Drawings?

Post by jmaustpc »

My FreeCAD is currently set to produce Part objects where available, but I could still make a Draft wire. I just inserted it from the Drawing workbench. I guess it finds the shape, that is underneath the Draft wire?
Post Reply