Implicit union
Implicit union
Posted Aug 26, 2020 23:15 UTC (Wed) by michaelkjohnson (subscriber, #41438)Parent article: The programmer's CAD: OpenSCAD
A minor clarification that might help those just learning OpenSCAD:
At this point in the process, the cylinder and cube are independent, overlapping solids to OpenSCAD. To join them together, we wrap the code with a union operation, which takes all of the solids defined within it and combines them into a single solid in the model.That's potentially misleading, depending on how it is read. The union operator is not needed to merely fuse geometrical elements. OpenSCAD doesn't have a concept of physically-conjoint independent objects, and mere concatenation of objects is geometrically sufficient. The union operator is useful in the context of other operators that interpret their child objects depending on position, primarily difference, as in the case that you used it. It's used to organize the object tree before rendering, and doesn't add semantics to the rendering process itself. Put another way, you are grouping operations not solids. From the manual's documentation of union:
Remark: union is implicit when not used. But it is mandatory, for example, in difference to group first child nodes into one.I've seen plenty of OpenSCAD code that overuses union and in fact especially in my first OpenSCAD code overused it a lot before I understood that point.
Posted Aug 27, 2020 18:10 UTC (Thu)
by coogle (guest, #138507)
[Link]
Implicit union
