Skip to main content

section

Function section 

Source
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

  1. For each face of the solid, compute the intersection with the cutting plane (line segments for planar faces).
  2. Collect all intersection segments.
  3. Assemble segments into closed wires.
  4. 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.