[OpenSCAD] Any thoughts on using units other than millimeters?
shadowwynd at gmail.com
Sun May 19 20:26:45 EDT 2019
I use both imperial and metric units almost daily in my shop, out of
necessity, not choice.
My 3D printer defaults to metric; my CNC machine is a UK-built metric
machine that uses "round" imperial units but is metric internally (both my
slicer and G-Code generators translate around the units).
However, the issue becomes hardware and parts. Metric hardware in the
stores has 1/10 :-) the selection of the imperial parts and usually costs
more. If I buy wood, all the stores sell it as imperial units, some sell
metric-cuts as imperial-rounded. It gets fun when sizes vary store-to-store
and even internally to a store. I buy metric drill bits from Amazon but
have /never/ seen one in a store; "similar" parts I use come in as either
30mm or 1-1/8" (28.6mm) and that 1.4mm makes a big difference when making
If I buy (3/4)" nominal plywood from one store, it is ~0.71" inches, but is
actually a solid 18mm.
If I buy (3/4)" nominal plywood from a store a block away, it is 0.75"
...not a big deal until you have a part with slots or finger joints.... it
just means that every CNC part has to have a "board thickness" variable.
Most of my code starts like this:
inch = 25.4;
length = 1.5*inch; // Some dimension in inches
width = 3.25*inch;
button_d = 28*mm; // Some dimension in mm
echo ("Width = ", width/inch);
I normally measure in metric; but I might start with the dimensions (in
inches) of the parts so that I can easily keep track of what I will need for
a build list. ALWAYS ALWAYS ALWAYS track the units and be explicit what
units are used for a particular part - NASA wasted $125 million learning
this lesson. It isn't uncommon for me to then add a metric "fudge" factor
to an imperial part to handle printing/machining tolerances - it is cleaner
and allows for easier tweaking.
hole_d = (1/8)*inch + 0.5; // Diameter of 1/8" plus a 0.5mm fudge
Sent from: http://forum.openscad.org/
More information about the Discuss