Discussion:
[OpenSCAD] unit of measure
MichaelAtOz
2015-12-04 01:54:20 UTC
Permalink
Hi, Welcome to the forum.

OpenSCAD is unitless.

When you translate it to some output device is where an assumption is made
what 1 is equal to.

Many 3D printers assume 1=1mm, but there are also plenty of designs in
inches, which means when you want to print them you need to scale it.

I'm a metric thinker, so I like to design assuming 1=1mm.

1inch=25.4mm (as I assume you know) so it is just a matter of scaling
up/down depending.

From my exposure, most OpenSCAD designs assume 1mm.

I suppose it comes down to how hard it may be to convert your scripts,
and/or how your head hurts thinking in other units of measure.





-----
Newly minted Admin - PM me if you need anything, or if I've done something stupid...

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!
--
View this message in context: http://forum.openscad.org/unit-of-measure-tp14926p14927.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
doug moen
2015-12-04 02:39:03 UTC
Permalink
For AMF export, the unit of measurement is 1 millimeter. That's hard coded.

There may be other cases of import or export where we support units of
measurement, but I'm not aware of them. I'm pretty sure that our STL, DXF
and SVG support is unitless.
Post by MichaelAtOz
Hi, Welcome to the forum.
OpenSCAD is unitless.
When you translate it to some output device is where an assumption is made
what 1 is equal to.
Many 3D printers assume 1=1mm, but there are also plenty of designs in
inches, which means when you want to print them you need to scale it.
I'm a metric thinker, so I like to design assuming 1=1mm.
1inch=25.4mm (as I assume you know) so it is just a matter of scaling
up/down depending.
From my exposure, most OpenSCAD designs assume 1mm.
I suppose it comes down to how hard it may be to convert your scripts,
and/or how your head hurts thinking in other units of measure.
-----
Newly minted Admin - PM me if you need anything, or if I've done something stupid...
Unless specifically shown otherwise above, my contribution is in the
Public Domain; to the extent possible under law, I have waived all
copyright and related or neighbouring rights to this work. Obviously
inclusion of works of previous authors is not included in the above.
The TPP is no simple “trade agreement.” Fight it!
http://www.ourfairdeal.org/ time is running out!
--
http://forum.openscad.org/unit-of-measure-tp14926p14927.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
_______________________________________________
OpenSCAD mailing list
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Neon22
2015-12-04 02:54:29 UTC
Permalink
I like that OpenSCAD is unitless.
User can easily scale output if they want a specific scale. E.g. at their 3D
printer stage.

However maybe its useful to add the constants for mmtoinch, etc... in case
someone wants to do that without looking it up.
In the same way many programs will add degreestoradians and radianstodegrees
as constants to be helpful to their users....?



--
View this message in context: http://forum.openscad.org/unit-of-measure-tp14926p14929.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
doug moen
2015-12-04 03:03:13 UTC
Permalink
mm_per_inch is already defined in <MCAD/constants.scad> and
<MCAD/math.scad>.
Also, math.scad defines deg(x) for converting x radians to degrees.
Post by Neon22
I like that OpenSCAD is unitless.
User can easily scale output if they want a specific scale. E.g. at their 3D
printer stage.
However maybe its useful to add the constants for mmtoinch, etc... in case
someone wants to do that without looking it up.
In the same way many programs will add degreestoradians and
radianstodegrees
as constants to be helpful to their users....?
--
http://forum.openscad.org/unit-of-measure-tp14926p14929.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
_______________________________________________
OpenSCAD mailing list
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Tim Hawkins
2015-12-04 03:24:46 UTC
Permalink
Surely this is just a case of adopting a convention and making it the case,
it should only impact exporters and importers.

If the community decided that the dimensional value 1.0 inside openscad
reffered to 1mm then all it needs is documentation to that effect.

Having it unitless only creates confusion, and opens the door for models to
be missinterpreted during exchange.

It would allow importers and exporters to work in real world units, for
example import dxf and export amf would work correctly and have the right
units
Post by doug moen
mm_per_inch is already defined in <MCAD/constants.scad> and
<MCAD/math.scad>.
Also, math.scad defines deg(x) for converting x radians to degrees.
Post by Neon22
I like that OpenSCAD is unitless.
User can easily scale output if they want a specific scale. E.g. at their 3D
printer stage.
However maybe its useful to add the constants for mmtoinch, etc... in case
someone wants to do that without looking it up.
In the same way many programs will add degreestoradians and
radianstodegrees
as constants to be helpful to their users....?
--
http://forum.openscad.org/unit-of-measure-tp14926p14929.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
_______________________________________________
OpenSCAD mailing list
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
_______________________________________________
OpenSCAD mailing list
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
ctchin
2015-12-05 04:35:26 UTC
Permalink
Post by Tim Hawkins
Surely this is just a case of adopting a convention and making it the case,
it should only impact exporters and importers.
If the community decided that the dimensional value 1.0 inside openscad
reffered to 1mm then all it needs is documentation to that effect.
Yes the community, not just the OpenSCAD, but the larger 3D printing/rapid
prototyping community, have decided and adopted a convention and
documentation
to that effect: the programs and data files shall be unit-less.

If you can convince the world to change the STL definition to adopt a
physical
unit, you are welcome to come back here to preach it for OpenSCAD.

https://wps3dprinter.wordpress.com/designing/stl-units/





--
View this message in context: http://forum.openscad.org/unit-of-measure-tp14926p14947.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
Alan Cox
2015-12-04 14:04:30 UTC
Permalink
Post by MichaelAtOz
Post by MichaelAtOz
From my exposure, most OpenSCAD designs assume 1mm.
I suppose it comes down to how hard it may be to convert your scripts,
and/or how your head hurts thinking in other units of measure.
That doesn't really work for a lot of applications. Consider a railway
model. It's drawn to full scale (about 21m long) taken from reference
drawings. It might be printed in a range of different model scales.

You might naïvely argue that the scale is then either "1:1 in mm" or
"whatever scale you wanted in mm" but actually its neither. The inputs to
the model consist of both elements scaled at 1:1 and elements scaled at
1:whatever because the wall thickness for example is dependant upon the
final result while the majority of the detail is based on the 1:1
dimensions.

Yes the final result might be at 1:1mm but the notion that its some kind
of generic unit throughout OpenSCAD just wouldn't work.

Other examples like screws have similar behaviour. You can elongate a
screw but generally the thread doesn't change dimensions. Often if you
make it bigger the same is true.

Alan
fractorr
2015-12-04 16:17:59 UTC
Permalink
Great, thanks for the info. I am looking at using sculpteo to print my
designs and it appears that their system assumes 1 = 1mm so I will just
create a function convert my dimensions to metric and generate one or two
pieces and then print a couple of different pieces just to test and make
sure everything comes out correct. Then if all looks good on the test
pieces I will generate all the pieces and do a mass print.




--
View this message in context: http://forum.openscad.org/unit-of-measure-tp14926p14942.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
david vanhorn
2015-12-04 19:24:53 UTC
Permalink
What I have done in OpenSCAD and similar languages like Povray is this:

Inch = 25.4
Foot = (12 * Inch)
and so on

It doesn't change anything, but you can then use the units that make sense,
as long as the software can deal with the scale. In Povray I worked on a
huge animation project where none of the modelers could agree on what a
unit should be, so I made a define that had every linear unit I could think
of from Light_Year to Micron Cubits, Furlongs, all were in there.
Post by fractorr
Great, thanks for the info. I am looking at using sculpteo to print my
designs and it appears that their system assumes 1 = 1mm so I will just
create a function convert my dimensions to metric and generate one or two
pieces and then print a couple of different pieces just to test and make
sure everything comes out correct. Then if all looks good on the test
pieces I will generate all the pieces and do a mass print.
--
http://forum.openscad.org/unit-of-measure-tp14926p14942.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
_______________________________________________
OpenSCAD mailing list
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
--
K1FZY (WA4TPW) SK 9/29/37-4/13/15
fractorr
2015-12-05 06:00:11 UTC
Permalink
I did not realize this question would cause such a stir. I had played around
with AutoCAD years back and everything was done in either inches or
millimeters. I figured the same was with OpenSCAD. So another question to
go along with this is what are the Scale Markers on the X, Y and Z axis?
Are they just units and not a millimeter or ???





--
View this message in context: http://forum.openscad.org/unit-of-measure-tp14926p14949.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
ctchin
2015-12-05 07:19:46 UTC
Permalink
Don't be apologetic, it's good to stir. It's a perfectly valid question and
there's
a perfectly valid answer. Perhaps it should be added to the FAQ.

AutoCAD is a different beast. There are many many functionalities that are
considered elementary by AutoCAD and most full featured CAD packages and
even some free software. But they are not found on OpenSCAD. I did learn
AutoCAD way way back then and over the years I have dabbled in a number of
(even Pro/E) alternatives. But I only stuck with a particular package for a
job
or two or three. None has the staying power for me to pick as a "career"
choice.
One big reason is that they are too "heavy", full featured and powerful, but
it's
a drain to keep myself, my students, PC and facility in a state to exploit
these full
packages. OpenSCAD, being almost rudimentary, is perfect for myself and my
lab. A new student can read the whole manual (imperfect as it is) in an
afternoon
and start making useful things in a few days.

I don't always write OpenSCAD programs with mm as units. My habit is to
design
most things in 1:1 scale, say if I'm building 1:144 Millennium Falcon, I
would
design it in OpenSCAD at 1:1 using meter as (implicit) unit and (perhaps) as
a
final step scale(1/144) the whole thing. Or much more likely, just leave it
at 1:1
and only fix the scale at the slicing or printing step.

Of course it doesn't always work like that, as Alan Cox wrote, there's a
minimum
scale (wall thickness) and maximum scale (printable volume) so blanket
application
of scale() doesn't work for more complicated designs. Things like screws do
have
an absolute size. I have run into that problem as well, designing a
spaceship in 1:1
(with 0.001" thick metal foil) only to find out the elegant program code
must be
messed up lots of exceptions and branching to deal with absolute scale of
the 3D
printer.



--
View this message in context: http://forum.openscad.org/unit-of-measure-tp14926p14950.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Loading...