How to export the correct STL that the whole file is horizontal?

Hi guys,

Here is my dome, I create the project based on the example. When I am trying to export the stl, It is wrong rotation.


I was trying to rotate the scene before export, but failed.
How to export the correct STL that the whole file is horizontal?

I’ve exported an STL file from your fiddle and imported it into the three.js editor. It seems the model is oriented correctly. Can you verify it with the editor, too?

If it works on your side, there might he an issue in the app that imports the STL.

export.stl (49.6 KB)

This is your exported file.

If you import into the three.js editor, it is correct. But by using normal applications to open it, it is oriented wrong. I tried applications such as print 3D, slic3r.

These viewers probably have a different camera up direction. When using the three.js editor, it’s Y-up. slic3r looks like Z-up.

To get the intended result, you need to rotated the object around the X-axis by Math.PI / 2 before exporting.

scene.rotation.x = Math.PI / 2 ;

I was trying to rotate the scene before export, the render scene works, but it didn’t work for the exported file~~~

It might be necessary to call updateMatrixWorld() before performing the export like in this fiddle:

https://jsfiddle.net/bqtj8nxz/

3 Likes

That’s so cooool ~~~ Thanks Mugen