API

Function createCsg2FromMesh

  • Builds a Csg2Solid from a mesh's CPU geometry, baking its world transform.

    Parameters

    • mesh: Mesh

      Source mesh; must retain CPU positions, normals, and indices.

    • materialSlot: number = 0

      Material slot index (0 to 65535) tagged onto the solid's triangles.

    Returns Csg2Solid

    A CSG2 solid; call disposeCsg2 when finished to free WASM memory.