Empty object
-
What is the canonical way to create an empty OpenJSCAD object?
I have some code where I need to union() several objects, but each of them is optional.
I would like to write something like:o = empty_object() if (cond1) { o = union(o, ...) } if (cond2) { o = union(o, ...) } if (cond3) { o = union(o, ...) }
I can probably do something like:
o = intersect(cube(), translate([0, 0, 100], cube()))
But I would rather have something more descriptive.
-
@udif great question!
There are three main objects; geom3, geom2, and path2. You can create empty versions of these…
const a = geom3.create() const b = geom2.create() const c = path2.create()