brepjs API Reference
    Preparing search index...

    Function exportGltf

    • Export a ShapeMesh to a glTF 2.0 JSON string with an embedded base64 buffer.

      The resulting string is a self-contained .gltf file that can be loaded directly by three.js, Babylon.js, or any glTF viewer.

      Parameters

      Returns string

      A JSON string representing the complete glTF document.

      const mesh = meshShape(solid);
      const gltfJson = exportGltf(mesh);

      exportGlb for the binary GLB variant.