Search code examples
openscad

OpenSCAD - what is a node?


I have noticed that the OpenSCAD documentation does not clarify whether the terms 'objects' and 'nodes' refer to the same thing or not. Objects are defined as 'building blocks', 'created by 2D and 3D primitives' and end with semi colons On the other hand nodes are operated on by transforms (e.g. child nodes; ). But since objects are also operated on by transforms it creates the perception that both terms refer to the same thing.

Please could someone define an OpenSCAD node and whether it is synonymous with a 2D or 3D object?

Regards


Solution

  • When a scad file is compiled, the compiler interprets the script as a tree (often called a syntax tree). Nodes are components of this tree. Nodes can include primitives that directly produce objects, or they can include operations like translate that operate on objects.

    Objects refer to stuff that gets rendered and the primitives that they come from. This includes the output of nodes in the tree.