Downloads the whole scene as a .babylon file, the engine's own JSON format that its editors
and loaders read back; the extension is added when missing.
The file name
Downloads the whole scene as a glb file, the binary glTF that most 3D tools and web viewers
read; discardSkyboxAndGrid leaves out the skybox and ground this library adds.
The file name and whether to leave out the skybox and ground
Writes the whole scene, or chosen nodes with their ancestors, as glb bytes without downloading
anything, so they can be saved, sent on or loaded back with loadGlbFromArrayBuffer.
Every ancestor of a chosen node is written too, so the geometry keeps its place, and the file carries the materials the meshes have at the time of the call.
The nodes to write, whether to leave out the skybox and ground, and whether to compress with Draco
The glb file as bytes
Downloads a mesh and its visible child meshes as one STL file, the plain triangle format 3D printers take; lines are left out.
The mesh and the file name
An empty object once the download has started
Downloads several meshes, with their child meshes, as one STL file; lines are left out.
The meshes and the file name
An empty object once the download has started
Loads a glTF, glb, STL or OBJ model from a File into the scene and gives back a container mesh with the model's meshes as its children; any other extension throws an error.
The loaded meshes cast and receive shadows and start hidden when hidden is true.
The model file and whether it starts hidden
The container mesh holding the loaded model
Loads a glTF, glb, STL or OBJ model from a File into the scene, as loadAssetIntoScene does,
without giving the mesh back.
The model file and whether it starts hidden
Loads a glTF, glb, STL or OBJ model from a web address into the scene and gives back a container mesh with the model's meshes as its children.
rootUrl is the folder and assetFile the file name in it, so textures beside the model
resolve too; the server must allow cross-origin requests.
The folder URL, the file name and whether it starts hidden
The container mesh holding the loaded model
Loads a model from a web address into the scene, as loadAssetIntoSceneFromRootUrl does,
without giving the mesh back.
The folder URL, the file name and whether it starts hidden
Loads a glb model held as bytes into the scene, such as the output of
occt.io.convertStepToGltf, and gives back a container mesh with the model's meshes as its
children.
The glb bytes, a name for the model and whether it starts hidden
The container mesh holding the loaded model
const glb = await bitbybit.occt.io.convertStepToGltf({ stepData: file, meshPrecision: 0.005, meshAngle: 0.5, meshRelative: true, internalVerticesMode: false, controlSurfaceDeflection: false });
const model = await bitbybit.babylon.io.loadGlbFromArrayBuffer({ glbData: glb, fileName: "part.glb", hidden: false });
Loads a glb model held as bytes into the scene, as loadGlbFromArrayBuffer does, without
giving the mesh back.
The glb bytes, a name for the model and whether it starts hidden
Loading models into the scene and exporting it: glTF, glb, STL and OBJ files come in from a File, a URL or raw glb bytes as one container mesh with their children under it, and the whole scene or chosen meshes go out as .babylon, glb or STL downloads.