Expand description
Sections of a triangle mesh by a plane: polylines that know which side the material is on.
Which side of the plane each vertex lies on is decided once per vertex,
by Exact::orient3d against three points spanning the plane, and every
triangle reads its corners’ sides from that one table. A triangle is cut
exactly when its corners disagree, the cut runs between the two edges
whose ends disagree, and two triangles sharing an edge agree on whether
it is cut because they share both ends’ sides. The chains therefore
neither break nor double, whatever the rounding of the points on them.
A vertex lying exactly in the plane counts as above it, on the side the
normal points to: the section is the one the plane gives moved an
infinitesimal distance against its normal. A cut edge whose upper end
lies in the plane is cut at that vertex itself, and the cuts through one
such vertex become one point of the chain. A triangle lying in the plane
is not cut, and is listed in Section::coplanar: a face in the plane
with the material below gives its outline, one with the material above
gives nothing, as the moved plane would.
Chains are welded by vertex index, through the edges two triangles share,
never by position. Each runs with the material on its left seen from the
side the normal points to, so an outer boundary runs counter-clockwise
and a hole clockwise, and outward is the direction of travel crossed
with the plane’s normal.