How to export an entire scene to stl?

Hi, I’m new to babylon.js and I have some job things to accomplish with the framework, so I made the entire thing that I had to do for my job and now I need to export the entire thing like all the meshes in one stl.

Is that possible?

Playground to have a context of what I want to export https://playground.babylonjs.com/#TFMJZC#2

BABYLON.STLExport.CreateSTL(scene.meshes, true , "stl-export", false, false);
Example - https://playground.babylonjs.com/#TFMJZC#4
The result in Sandbox

3 Likes

So scene.meshes calls every mesh in the project, gonna have in mind for that next time! Thanks for your help :D, just one thing, it is possible to export it with textures?

Yes, scene.meshes returns an array of all meshes of the scene; the same with scene.materials, scene.textures, scene.lights etc., as here - Scene | Babylon.js Documentation
Alas, STL format doesn’t support textures.
If you are able to print from OBJ - better choose this format as more flexible one.

1 Like