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. Given the
unit the scene is modelled in, the file is in metres, glTF's own unit.
The file name, whether to leave out the skybox and ground, and the unit
Writes the whole scene, or chosen nodes, as glb bytes without downloading anything, to save,
send on or load back with loadGlbFromArrayBuffer.
Every ancestor of a chosen node is written too, so the geometry keeps its place, with the
meshes' materials as they are. With the scene's unit, the file is in metres.
The nodes to write, whether to leave out the skybox and ground, whether to compress with Draco, and the unit
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. Like drawn
meshes, they are not pickable until bitbybit.babylon.mesh.setPickable makes them so.
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 in it, so textures beside the model resolve;
the server must allow cross-origin requests. The meshes are not pickable until
bitbybit.babylon.mesh.setPickable makes them so.
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.
Like drawn meshes, the loaded ones are not pickable until bitbybit.babylon.mesh.setPickable
makes them so.
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.