[OpenSCAD] Specification of CSG file format?
arnholm at arnholm.org
Sun May 17 18:11:58 EDT 2015
The following is an attempt to understand exactly the nature and formal
definition of *.csg files, formulated through a few questions.
Background: In OpenSCAD we have a capability to export a design to a
*.csg file. OpenSCAD can also open such files via File -> Open ... or
via a command line parameter.
My first question is whether *.csg files are specific to OpenSCAD or
whether they represent some kind of universal standardised CSG tree
representation. I have not found a clear answer, but when I inspect the
OpenSCAD-generated *.csg files, it seems to me they are is OpenSCAD
specific. Is this a correct understanding? I know other programs have
made import filters for such files, but then the only "contract" is
OpenSCAD documentation, right?
Second, is it correct to say that the contents of a *.csg file generated
or read by OpenSCAD is a subset of the *.scad language, where only
literal values exist and transformations are expressed as 4x4
homogeneous transformation matrices *only* ("multmatrix")? If this is
correct, is the subset language used in *.csg files documented anywhere?
Third, there also seems to be an extension "group()" to the *.scad
language. Is it correct to say that "group()" in *.csg is a direct 1:1
unnamed equivalent to a "module" in *.scad? And, is there any difference
at all between "group()" and "union()" in *.csg files? It seems to me
the answer is no, apart from "group()" indicating what used to be a module?
More information about the Discuss