Module projection_outline

Module projection_outline 

Source
Expand description

Winding-independent 2D footprint outline of a mesh, for construction projection on 2D floor plans (issue #979).

Normal-based silhouette extraction (the TypeScript EdgeExtractor fallback) needs consistent triangle winding to tell front faces from back faces — but ifc-lite meshes are rendered double-sided precisely because their winding is not reliable, so a globally-flipped roof or stair can lose its silhouette entirely.

This module is robust to winding because it works on triangle areas, not normals: every triangle is projected onto the section plane, each projected triangle is forced counter-clockwise, and the whole set is unioned with i_overlay (the same 2D boolean engine the CSG/void paths use). The boundary of that union is the true projected footprint outline regardless of the source winding.

The 2D projection matches projectTo2D in @ifc-lite/drawing-2d exactly (getProjectionAxes + the flipped-U mirror), so the returned contours land in the same drawing space as the section-cut polygons.

Structs§

MeshOutline
One element’s projected footprint outline.

Enums§

NoOutline
Why mesh_outline_2d produced no outline. The two are different answers for the caller: an Empty element has no footprint to draw; an OverBudget one has a footprint that was not computed.
ProjectionAxis
Section axis perpendicular to the cut plane (geometric, WebGL Y-up).

Constants§

MAX_OVERLAY_TRIANGLES
Maximum number of triangles to feed into the i_overlay union. A mesh with more valid projected triangles is refused with NoOutline::OverBudget as soon as the projection loop crosses the cap, before the union runs, to bound computation time on pathological geometry.

Functions§

mesh_outline_2d
Compute the winding-independent 2D footprint outline of a triangle mesh.