On 9/2/2022 12:42 PM, andrew goh via Discuss wrote:
I'd guess unlike general computer graphics, 3d solid modelling has to
be solids. Hence, it is more complex than simply stitching surfaces
together.
Yes and no. Indeed, OpenSCAD does not natively stitch surfaces
together. It barely tolerates surfaces as a concept. However, that
doesn't mean that it can't be done. BOSL2 does it.
For historical reasons I don't use BOSL2 myself and so can't immediately
give examples, but in my own work I have a "bez" function that accepts
control points as arguments and returns a list of points along the
curve. I can then use concat() and other list manipulation tools to
stitch them together into a single list of points, which I can then pass
to polygon() to turn into a 2D object. (And thence to linear_extrude()
to turn into a 3D object.)
I haven't done much with stitching Bézier surfaces together, but the
BOSL2 documentation has some examples.
See Example 2-4 under
https://github.com/revarbat/BOSL2/wiki/beziers.scad#function-bezier_vnf .