Babylon to .STL file for 3D printing

Is there a way to export a scene from Babylon to .stl?

AstroPrint has an API to print directly from javascript, so it would be nice to connect the dots and allow user to print their creations from babylon:

We do not yet but that is something I would love to get if someone wants to try
We do have OBJ and glTF exporters already

Hopefully someone will, thanks

I wrote up an ASCII STL exporter… one second.

1 Like

cause I <3 you:

this has been tested with 3d prints as well, and worked flawlessly. Let me know if you run into any issues.



Should we add this to the exporters?

man! yes!

(and a good exercice for your TS practicing :wink: )

haha ok :slight_smile: actually great point! I just installed TS on my rig last night globally and was thinking about doing my first script, this might actually be a good opportunity you are right.

Ill start on it after I get done with work today.

1 Like

Also wondering if there is a way that the file exported file could live in cache so that it could be a one step process to print through the astroprint api, rather than download a file and then navigating to it…or needing to manage file write on a server.

Just pass it as a buffer?

var blob = new Blob([content], {‘type’:contentType});

that should be all the binaryBuffer data your print process should need. I would have to look at the astroprint api though.

Sounds good

I just added binary support and put a PR up tonight.

I tested it out and it worked well, figured it will get merged tomorrow!

@gamedev44 Thought that might interest you as well, if you are trying to pass it as a binary buffer to your printer.

Ill write up some docs on its usage tomorrow. If you need arguments like scaling or world up vector let me know.

I just have one concern regarding indentation and then I merge and publish :slight_smile:

1 Like