Function bounded_half_space_in_frame

Source
pub fn bounded_half_space_in_frame(
    boundary: &Rings,
    plane: Plane3,
    frame: PlaneFrame,
    agreement: bool,
    margin: ClipMargin,
    tolerance: Tolerance,
) -> Result<TriMesh, GeomError>
Expand description

Build a bounded half-space with an explicitly authored in-plane frame.

bounded_half_space derives the boundary’s in-plane axes from the clip plane normal alone, which fixes only 2 of the 3 orientation degrees of freedom: the rotation ABOUT the normal is picked by an internal heuristic. That is fine when the profile carries no authored orientation of its own.

It is not fine when the source format authors one. IFC’s IfcPolygonalBoundedHalfSpace.Position is an placement explicitly independent of BaseSurface, and its PolygonalBoundary is expressed in THAT frame. Deriving the axes instead of honouring the authored ones silently rotates the clipping profile about the plane normal, so the wrong region of the subject is cut.

The frame’s own axes are used as written. Its normal is not required to match plane.normal: only the in-plane axes are taken from it, and the sweep still runs along the clip plane’s normal, so an authored frame that is tilted relative to the clip plane still contributes only its rotation about that normal.

The frame’s origin anchors the boundary, projected onto the clip plane: an in-plane offset from plane.origin moves the footprint by exactly that offset, and the component along the normal is dropped so the sweep still starts on the clip plane.