Selections
For some operations it is required to select certain parts of an object, e.g. to apply a selective transformation on. This can be done via the selection data type that represents a spatial region that may be used for defining the parts of the object.
The selection data type
The data type selection denotes one or more regions of the construction space with the purpose to define parts of objects. There are two data types selectbox and selectsphere and boolean operators to build up the selection.
The first data type is
selectbox( float, float, float, float, float, float )
and it creates an axis-aligned rectangular selection region that spans over the coordinates [Xmin,Xmax], [Ymin,Ymax] and [Zmin,Zmax]. The six boundary values are given to the constructor as floating point arguments in the same order as their appeared in the last sentence. Each boundary can be accessed as a member of type selectbox.minx, selectbox.maxx etc.
The second data type is
selectsphere( float, vector )
that defines a spherical region with a radius (first argument) and a center point (second argument).
Selections may be combined with the boolean operators '+' and '-'.
The following example defines a selection that consists of a cube with one edge removed:
Example
selection s = selectbox( 0.0, 1.0, 0.0, 1.0, 0.0, 1.0 ) - selectsphere( 0.25, <[1.0, 1.0, 1.0 ]> )