On 4/16/2021 12:34 PM, William F. Adams
via Discuss wrote:
Am I dense,
or does OpenSCAD lack the programming constructs to readily
and directly put all the parts into a list, and then parse
each object in the list for its geometry and then work out
how to fit them together so as to efficiently cut them out
of a wooden board? (In particular, in retrospect I should
have rotated one of the ends 180 degrees so that they could
have fit more closely together).
OpenSCAD has decent, perhaps not great, list support.
What it doesn't have is any way to extract geometry information out
of constructed objects.
That is, you can describe a cube like so:
c = [
[ // points
], [ // faces
[0,2,3,1], // left
[0,4,6,2], // bottom
[0,1,5,4], // front
[1,3,7,5], // top
[4,5,7,6], // right
[2,6,7,3], // back
and do whatever you like to the points before you hand them to
polyhedron(), but if you use a primitive to construct your cube:
then you can't get any information whatsoever about it.
For the kind of project you're talking about, I would define each
slab as a module, and then I would assemble those modules twice,
once to form the finished object (so as to check fit and look) and
once to form the as-printed components. (Or, in your case,
There are other similar techniques. One that I've used is to
have two translations and two rotations for each piece, where one
position/rotation is the as-assembled position, and the other is
the as-printed position. It's then not too hard to animate
between the two, so that the pieces fly from the print bed to the
constructed model and back again.
OpenSCAD mailing list
To unsubscribe send an email to [hidden email]