Compute the winding-robust 2D footprint outline of a triangle mesh.
positions is flat XYZ; indices is flat triangle indices. axis is
0/1/2 = x/y/z (the cut axis, WebGL Y-up). Returns undefined when the mesh
has no triangles or projects to nothing: the element has no footprint.
THROWS when the outline was not computed: an axis outside 0..=2, or a
mesh with more valid projected triangles than the overlay budget (50 000).
The viewer's outline provider catches the throw and draws its TypeScript
silhouette for that mesh.
constoutline = meshOutline2d(positions, indices, 1, false); // axis 1 = y if (outline) { for (leti = 0; i < outline.contourCount; i++) { constring = outline.contour(i); // Float32Array of [u0, v0, u1, v1, ...] } outline.free(); }
Compute the winding-robust 2D footprint outline of a triangle mesh.
positionsis flat XYZ;indicesis flat triangle indices.axisis 0/1/2 = x/y/z (the cut axis, WebGL Y-up). Returnsundefinedwhen the mesh has no triangles or projects to nothing: the element has no footprint.THROWS when the outline was not computed: an
axisoutside 0..=2, or a mesh with more valid projected triangles than the overlay budget (50 000). The viewer's outline provider catches the throw and draws its TypeScript silhouette for that mesh.