unit of measure

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

unit of measure

fractorr
This post has NOT been accepted by the mailing list yet.
I am newbie to OpenSCAD and CAD in general.  So here is my newbie question for the day.

I have a system I built for generating various basic shapes with several holes through the shapes.  My system however is only 2 dimensional and I would like to be creating these shapes in 3 dimension and I am looking at using OpenSCAD since it is programmable and Open Source.  

The scripts I have for generating the current shapes are based on inches.  So my question is there any way to use inches in OpenSCD? Would I just convert the inches into millimeters and just use millimeters as my unit of measure?

Reply | Threaded
Open this post in threaded view
|

Re: unit of measure

MichaelAtOz
Administrator
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.

Admin - email* me if you need anything,
or if I've done something stupid...
* click on my MichaelAtOz label, there is a link to email me.

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!
Reply | Threaded
Open this post in threaded view
|

Re: unit of measure

doug.moen
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.


On 3 December 2015 at 20:54, MichaelAtOz <[hidden email]> wrote:
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.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: unit of measure

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....?
Reply | Threaded
Open this post in threaded view
|

Re: unit of measure

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.

On 3 December 2015 at 21:54, Neon22 <[hidden email]> wrote:
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.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org




_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: unit of measure

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.

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


On Fri, Dec 4, 2015, 11:04 doug moen <[hidden email]> wrote:
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.

On 3 December 2015 at 21:54, Neon22 <[hidden email]> wrote:
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.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: unit of measure

Alan Cox
In reply to this 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

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: unit of measure

fractorr
In reply to this post by MichaelAtOz
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.
Reply | Threaded
Open this post in threaded view
|

Re: unit of measure

dbvanhorn
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.


On Fri, Dec 4, 2015 at 9:17 AM, fractorr <[hidden email]> wrote:
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.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org



--
K1FZY (WA4TPW) SK  9/29/37-4/13/15

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: unit of measure

ctchin
In reply to this post by Tim Hawkins
Tim Hawkins wrote
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/

Reply | Threaded
Open this post in threaded view
|

Re: unit of measure

fractorr
In reply to this post by fractorr
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 ???

Reply | Threaded
Open this post in threaded view
|

Re: unit of measure

ctchin
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.