fast-mesh-wasm
    Preparing search index...

    Function exportGLTF

    • glTF 2.0: one node, one mesh, one TRIANGLES primitive with POSITION (plus TEXCOORD_0 as float pairs where the mesh has UVs, NORMAL where present and COLOR_0 as normalized RGBA bytes where the mesh is colored). Binary (default) returns a .glb; binary: false a .gltf JSON with the buffer embedded as a base64 data URI.

      Pass draco: true for KHR_draco_mesh_compression instead: the call becomes async (a Promise<Uint8Array>), encoding through the draco3d encoder (WASM), which lazy-loads like the decoder.

      Parameters

      Returns Uint8Array

    • glTF 2.0 with draco: true: the same node, mesh and TRIANGLES primitive, but the positions (plus normals, colors and UVs where present) ride a Draco bitstream in one buffer view instead of raw buffer views. The primitive's accessors describe the decoded shape (POSITION keeps its min/max); extensionsUsed/extensionsRequired name the extension.

      The draco3d encoder (WASM) initializes on first use; its module is shared across calls. Needs the draco3d package installed unless dracoOptions supplies the module or its .wasm. Reads back through importGLTFAsync (compressed attributes beyond POSITION stay unmapped there); the sync importGLTF still throws on it.

      Parameters

      Returns Promise<Uint8Array<ArrayBufferLike>>

    • glTF 2.0: one node, one mesh, one TRIANGLES primitive with POSITION (plus TEXCOORD_0 as float pairs where the mesh has UVs, NORMAL where present and COLOR_0 as normalized RGBA bytes where the mesh is colored). Binary (default) returns a .glb; binary: false a .gltf JSON with the buffer embedded as a base64 data URI.

      Pass draco: true for KHR_draco_mesh_compression instead: the call becomes async (a Promise<Uint8Array>), encoding through the draco3d encoder (WASM), which lazy-loads like the decoder.

      Parameters

      Returns Uint8Array<ArrayBufferLike> | Promise<Uint8Array<ArrayBufferLike>>