I want to export my threeJS scene to STL file. I am using this exporter : https://gist.github.com/kjlubick/fb6ba9c51df63ba0951f
My problem is the file size that I get. For example, for 4 spheres (created via new THREE.SphereGeometry(1,32, 32)
) I got a file of 15MB, which I think is huge if you think that this ball here : http://archive3d.net/?a=download&id=469e26a6 is less than 0.5 MB.
Is there any way to reduce the file size? Why is it so big for just 4 spheres?
One way is to create some low res (new THREE.SphereGeometry(1, 16, 16)
) temp spheres at the time of exporting and delete them afterwards, but is there any other better way?
EDIT : I had done a mistake independently from the exporting process, and when I corrected it the size went down to 6 MB but it is still very big for just 2 spheres.
Thank you in advance, any opinion will be appreciated.
The exported you have linked uses the ASCII STL format, which by its nature is quite verbose and takes up a significant number of bytes to store a single triangle. Each of your spheres would be composed of several thousand triangles. Options are to:
0.1
rather than 0.100001
it will take less characters to hold your result (but you will lose precision).* Assuming 32 * 32 * 2 triangles per sphere, 32 * 32 * 2 * 50 = ~100e3 = ~0.1MB