Parametric Object Party Day 3: Solid Constructive Geometry

thing_fan
Yesterday, I gave my spiel on parametric geometry using GCodes, now it’s Marius’ turn!

Solid Constructive Geometry is a tool that can make many shapes very easy to construct which would be dreadfully difficult in a mesh-based system like Blender or using GCode scripting.  It also shares GCode scripting’s property of being natively parameter-friendly!  Thingiverse users have been doing great things with it already.

From Marius’ notes on CSG:
As opposed to Allan, we’re using parametric modeling techniques which generate 3D models in the STL format. We can then hook up to the normal processing pipeline for STL models, as described by Allan.

One of the obstacles to overcome when modeling for the Makerbot is that the models need to be solid, aka. watertight.
This means that the object must describe a closed volume. Duplicate edges, intersecting meshes, freely floating triangles etc. is a no-go.

We’re using a modeling technique called CSG (Constructive Solid Geometry). This works by starting with two solid primitives and performing one of three basic operations on these primitives, creating a new object. The operations are union, difference and intersection. The resulting objects can then be used as new starting objects and we can thus build more complex solid models. The wikipedia article describes this process quite well.

In addition to typical primitives (spheres, cubes, cylinders, cones), we can also start with a 2D outline (e.g. modeled in a 2D CAD tool like QCAD/AutoCAD) and create a solid object based on that using either linear extrusion or rotation of a curve around some axis.

“Parametrized” in this context means that all parameters used to construct or orient the different primitives can be configured using some kind of light-weight scripting language with visual 3D feedback for each step. Typical programming constructs such as variables, macros/functions and for loops are also supported.

Now, to the actual software:

1) As a start, we developed smth. called “CSG Evaluator”, which is not parametric, but is very helpful building CSG-based models.  This is released and in active use by the RepRap developers:
http://objects.reprap.org/wiki/Builders/Metalab/AoI_CSG_Evaluator
This is a plugin to Art of Illusion, which I assume you’re familiar with already.  Written by Philipp Tiefenbacher and me. We’re both from the Metalab in Vienna and RepRap core developers.

2) Based on CSG Evaluator, we then wrote another Art of Illusion plugin: MetaCAD (http://metacad.org).  This is also written by Philipp and me.MetaCAD is a parametric modeler using Art of Illusion for rendering and geometry evaluation.  It’s downloadable and useful, but unfortunately not yet released.  This is due to some ugly bugs in Art of Illusionwhich makes the application freeze when the model becomes too complex.  Nevertheless, the plugin is quite useful, but we lost some momentum and motivation due to the outstanding bugs in Art of Illusion :(

3) The future solution: OpenSCAD (http://openscad.org).  This is written by Clifford Wolf, another friend of ours from
the Metalab.  He wrote this to decouple the MetaCAD idea from Art of Illusion to avoid being bound by bugs as mentioned above.

OpenSCAD is very similar to MetaCAD, maybe more targeted towards programmers than modelers.  It uses a scripting language to build CSG objects.  It has a built-in 3D preview enabling inspection of both the final object and intermediate objects.

Earlier problems with long evaluation times for CSG objects has been solved using 3D-accelerated real-time preview.
OpenSCAD is currently under development but it’s pretty stable and runs under Windows and Linux.  A port for Mac OS X is upcoming.

5 Comments »

  1. zignig Said,

    October 23, 2009 @ 6:08 am

    That’s really cool.

    It harks back to running hand coded povray on my pentium 75Mhz.

    Now I just need a thousand spare hours to code up all the mendel parts.

    parametricly.

  2. Haskell foo Said,

    October 23, 2009 @ 11:25 am

    Maybe people will jump straigt to Haskell? It is huge and some parts are based on difficult theories, but on the other Hand for a programmer it can be reasonably easy because it is based on a simple thing called lambda calcus (that hides intuitive knowledge in a verbose notation). I just coincidentally found a package for solid geometry, still in it’s infancay: http://en.serchilo.net/hdb+mecha

  3. Haskell foo Said,

    October 23, 2009 @ 11:31 am

    Better say calculus than “calcus”…

  4. Tacit Said,

    October 27, 2009 @ 12:30 pm

    Is this something like Brl-cad? Or should I think of it as something else.

  5. Neon22 Said,

    October 27, 2009 @ 6:20 pm

    BRL Cad an open source project has great CSG authoring and export. http://brlcad.org/
    but not to Gcode.

    Its been around since 1970s so its UI is a bit archaic but still in dev. Great project

Leave a Comment