Module coplanar

Source
Expand description

Overlap between two coplanar triangles.

§Why this exists

Two coplanar faces meet in an AREA, not a curve, so the intersection-curve module cannot describe them and used to refuse the whole operation. Real building models hit this constantly: flush walls, stacked slabs, a column sharing a face with the floor it stands on.

§What it computes

The overlap polygon of the two triangles, exactly. Both are convex, so the overlap is a convex polygon of at most six vertices, obtained by clipping one against each edge of the other.

Two results matter to the caller and are deliberately distinguished:

  • Empty – the faces share a plane but no area. They contribute nothing, and refusing the operation over them would be wrong. Measured: two walls in one plane five metres apart produce sixteen coplanar face pairs and zero shared area.
  • Non-empty – the polygon’s boundary is where the surfaces stop coinciding, and those edges constrain the retriangulation of both faces.

§Exactness

Every inside/outside decision is an orient2d sign. Vertex positions of the clipped polygon are computed only after the crossing they represent has been proven to exist, the same discipline the intersection curve uses.

Functions§

coplanar_overlap
The overlap of two coplanar triangles, as a 3D polygon.
dominant_axis
The dominant axis of normal, dropped when projecting to 2D.
project
Drop axis from point, giving the 2D projection.