[OpenSCAD] How can I tell what OpenSCAD is doing?

Parkinbot rudolf at parkinbot.com
Mon Oct 10 13:31:23 EDT 2016


DanS wrote
> Do I need to tell OpenSCAD how to form triangles or
> does it automatically do that between adjacent polygon slices?

Yes and no! 
For the yes-part: Yes, you need to define a proper polyhedron to get your
fancy 3D object. 
For the no-part: No, in many cases, like for general extrusion, you can use
sweep(), or skin() (which is equivalent) functionality. Have a look at the
"Threading" reference at Thingiverse I gave. 

You feed sweep()/skin() with a vector of polygons (living in 3D) that
describe your "thing" by a series of slices. Each "polygon" is represented
as a vector of 3D points and has to be properly positioned in space, so that
neither two polygons intersect. How you to get this? Define the polygon as
2D and then use affine transformations (translations, rotations, and
scaling) to place it into 3D. There is no test for self-intersection. This
is your own responsibility. 
Sweep() will connect all polygons into a polyhedron and do the hard work for
you. While this approach is quite mighty, you can only model
non-self-intersecting extrusions with it. For a donut you'd produce to
half-donuts and union them together. This is, what I did for the Threadings. 

Rudolf 




--
View this message in context: http://forum.openscad.org/How-can-I-tell-what-OpenSCAD-is-doing-tp18632p18657.html
Sent from the OpenSCAD mailing list archive at Nabble.com.




More information about the Discuss mailing list