IFClite TypeScript API
    Preparing search index...

    Function meshOutline2d

    • 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.

      const outline = meshOutline2d(positions, indices, 1, false); // axis 1 = y
      if (outline) {
      for (let i = 0; i < outline.contourCount; i++) {
      const ring = outline.contour(i); // Float32Array of [u0, v0, u1, v1, ...]
      }
      outline.free();
      }

      Parameters

      • positions: Float32Array
      • indices: Uint32Array
      • axis: number
      • flipped: boolean

      Returns MeshOutlineJs | undefined