2.3. CSG Operations¶

class
raysect.primitive.csg.
CSGPrimitive
¶ Bases:
raysect.core.scenegraph.primitive.Primitive
Constructive Solid Geometry (CSG) Primitive base class.
This is an abstract base class and can not be used directly.
CSG is a modeling technique that uses Boolean operations like union and intersection to combine 3D solids. For example, the volumes of a sphere and box could be unified with the ‘union’ operation to create a primitive with the combined volume of the underlying primitives.
Parameters:  primitive_a (Primitive) – Component primitive A of the compound primitive.
 primitive_b (Primitive) – Component primitive B of the compound primitive.
 parent (Node) – Scenegraph parent node or None (default = None).
 transform (AffineMatrix3D) – An AffineMatrix3D defining the local coordinate system relative to the scenegraph parent (default = identity matrix).
 material (Material) – A Material object defining the CSG primitive’s material (default = None).

class
raysect.primitive.csg.
Union
¶ Bases:
raysect.primitive.csg.CSGPrimitive
CSGPrimitive that is the volumetric union of primitives A and B.
All of the original volume from A and B will be in the new primitive.
Parameters:  primitive_a (Primitive) – Component primitive A of the union operation.
 primitive_b (Primitive) – Component primitive B of the union operation.
 parent (Node) – Scenegraph parent node or None (default = None).
 transform (AffineMatrix3D) – An AffineMatrix3D defining the local coordinate system relative to the scenegraph parent (default = identity matrix).
 material (Material) – A Material object defining the new CSG primitive’s material (default = None).

class
raysect.primitive.csg.
Intersect
¶ Bases:
raysect.primitive.csg.CSGPrimitive
CSGPrimitive that is the volumetric intersection of primitives A and B.
Only volumes that are present in both primtives will be present in the new CSG primitive.
Parameters:  primitive_a (Primitive) – Component primitive A of the intersection operation.
 primitive_b (Primitive) – Component primitive B of the intersection operation.
 parent (Node) – Scenegraph parent node or None (default = None).
 transform (AffineMatrix3D) – An AffineMatrix3D defining the local coordinate system relative to the scenegraph parent (default = identity matrix).
 material (Material) – A Material object defining the new CSG primitive’s material (default = None).

class
raysect.primitive.csg.
Subtract
¶ Bases:
raysect.primitive.csg.CSGPrimitive
CSGPrimitive that is the remaining volume of primitive A minus volume B.
Only volumes that are unique to primitive A and don’t overlap with primitive B will be in the new CSG primitive.
Parameters:  primitive_a (Primitive) – Component primitive A of the intersection operation.
 primitive_b (Primitive) – Component primitive B of the intersection operation.
 parent (Node) – Scenegraph parent node or None (default = None).
 transform (AffineMatrix3D) – An AffineMatrix3D defining the local coordinate system relative to the scenegraph parent (default = identity matrix).
 material (Material) – A Material object defining the new CSG primitive’s material (default = None).