Function clip_arc_prism_exact

Source
pub fn clip_arc_prism_exact(
    prism: &ArcPrism,
    half_space: &HalfSpace,
    tolerance: Tolerance,
) -> Result<ExactBRep, GeomError>
Expand description

Cut an arc prism with a half-space: the prism’s material on the kept side of a plane (#120).

This is the “round column under a sloped roof” case. When the plane passes cleanly through the prism – above its bottom and below its top everywhere over the section – the result is the same prism with one cap replaced by the cut:

  • each cylindrical wall now ends on an ELLIPSE (the exact cylinder/plane intersection, #119), trimmed on the wall by the Sinusoid2 pcurve (ADR 0071), so the wall stays a true Cylinder face;
  • each planar wall ends on a sloped straight edge;
  • the new cap is a planar face in the cutting plane.

half_space.agreement picks the kept side as elsewhere: true keeps the side the boundary normal points into. A plane tilted towards the kept side replaces the bottom cap, otherwise the top cap. The untouched cap keeps its StartCap/EndCap name; the cut cap is unnamed, because it is a fragment of the half-space, not of the prism.

A plane that crosses a cap inside the section leaves part of that cap in place and cuts the rest away: the result keeps the named fragment of the original cap beside the unnamed cut face, and the walls there end partly on the cap and partly on the cut. That shape is built by the column builder over the section split along the cap’s crossing line.

§Refused, by name

  • a plane parallel to the extrusion axis (a plan cut, not a cap cut);
  • a plane that crosses a cap along a line that splits the kept material into separate pieces, which one ExactBRep cannot hold (a concave section can do this);
  • a plane that misses the prism on the kept side entirely (the result is empty; this is a GeomError::Degenerate, matching the other exact booleans’ empty results).

A plane that keeps the whole prism returns the prism unchanged.