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§
- Mesh
Outline - One element’s projected footprint outline.
Enums§
- NoOutline
- Why
mesh_outline_2dproduced no outline. The two are different answers for the caller: anEmptyelement has no footprint to draw; anOverBudgetone has a footprint that was not computed. - Projection
Axis - 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::OverBudgetas 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.