pub fn section(
topo: &mut Topology,
solid: SolidId,
plane_point: Point3,
plane_normal: Vec3,
) -> Result<Section, OperationsError>Expand description
Compute the cross-section of a solid with a plane.
The cutting plane is defined by a point on the plane and its normal. Returns the cross-section as one or more planar faces lying on the cutting plane. For a simple convex solid this is typically one face; for solids with holes or disconnected volumes there may be multiple. A plane that misses the solid entirely yields an empty face list (a successful empty result, not an error).
§Algorithm
- For each face of the solid, compute the intersection with the cutting plane (line segments for planar faces).
- Collect all intersection segments.
- Assemble segments into closed wires.
- Create planar faces from the wires.
§Errors
Returns an error if NURBS intersection computation fails, or if intersection segments exist but cannot be assembled into a closed cross-section wire.