Skip to main content

Module csg

Module csg 

Source
Expand description

CSG solids and swept-disk solids.

§IfcCsgSolid is a wrapper, not a shape

Its single TreeRootExpression is either a boolean result or a primitive. The solid itself contributes no geometry, so it lowers to whatever its root lowers to. Emitting a distinct node for the wrapper would add a graph level that no consumer can act on.

§Primitives are local, placement is separate

IfcCsgPrimitive3D subtypes define their shape in their OWN coordinate system: an IfcBlock always sits with a corner at its local origin and extends along +x/+y/+z. The Position places it. Primitive::Block in the kernel is likewise local-only, so the placement must ride on an Instance node – folding it into the extents would be wrong for any non-identity rotation and would silently discard the origin offset.

The anchors differ, though. The neutral block is CENTRED on its origin (the axiolid-reference 0.3 tessellator; axiolid-primitive states no anchor), while IfcBlock has a corner there (IFC4 ADD2 TC1). The Instance therefore also carries a half-extent shift inside the block’s own frame; without it every compiled block sits half its size away from where the file put it. The other primitives already agree: sphere centred, cylinder, cone and rectangular pyramid with the base centred on the origin and height along +z, in both definitions.

§Swept disks sweep a DISK, not a profile

IfcSweptDiskSolid has no IfcProfileDef: the radii are given directly. InnerRadius makes it a pipe. The directrix is a curve, which is why this family waited for curve lowering.

Functions§

lower_csg_primitive_node
Lower an IfcCsgPrimitive3D subtype into a placed primitive.
lower_csg_solid_node
Lower an IfcCsgSolid by lowering its tree root.
lower_surface_curve_swept_area_solid_node
Lower an IfcSurfaceCurveSweptAreaSolid into a SurfaceCurveSweep.
lower_swept_disk_node
Lower an IfcSweptDiskSolid into a SweptDisk operation.