Export smooth models in STL and OBJ

This week has been very exciting. Some users have pushed 3DTin models to new boundaries – they printed them using Makerbot.

Check out this ball maze and a castle, printed on Makerbot and designed in 3DTin. There are many more 3DTin models floating around in Thingiverse waiting to be born in the real world via a 3D printer.

I am sure you want to go beyond the orthogonal sufaces, pointy edges and sharp corners. And that day has come.

Just save the sketch at a smoothness you like and hit export. The export dialog has changed a little.

You can now choose the format and destination from the drop down menu and press download. You will get the OBJ/STL file in the same smooth form that you see in your browser.

Here is an example of a smoothened sketch exported as OBJ/STL and opened in Blender, MeshLabs and Thingiverse. The 3DTin sketch is here.

Behind the curtains

I would like to share what’s going on behind the scenes for this export to happen and why this has taken so long. As some of you may already know, 3DTin is hosted on Google App Engine – written in python. The export of cubicle mode sketches that were available so far were generated from this python app. I had to re-write the client side javascript logic in python to make it run in the GAE cloud. This approach had couple of difficulties. 1. Google App Engine doesn’t like long running requests and exporting smoothened sketches with lots of polygons requires serious horse power. 2. Re-writing and maintaining same logic in two languages is not a good software design practice. Therefore I decided to redesign the whole export-in-cloud service about couple weeks ago.

The new export is done by a dedicated server – factory.3dtin.com. It is hosted in Amazon EC2 cloud and runs the bleeding edge web framework – Node.js 0.3.7. Using node.js, allows the factory server to run the same javascript code that runs in users’ browsers. The EC2 instance is a High CPU dual core instance, dedicated to the export job only, which improves the response time of generating smooth sketches. Past 3-4 days were spent in hacking Node.js administration. But now everything is in place and the factory is ready to serve you.

Caveats

As I mentioned above, generating high-poly smoothened sketches is a CPU-intensive task. Even when it’s done on a dedicated machine with high processing power, it takes longer than a regular http request should take to return. Therefore a limit has been put on the number of polygons allowed in such exports. For now the limit is set to 5000 polygons. If the factory server finds that at a given smoothness the number of polygons exceeds this limit, then it will reduce the smoothness until the number  of generated polygons is manageable, in worst case falling back to cubicle mode export. In future I plan to work on improving the smoothing algorithms so that you get better results in lesser time. I have suggestions from some power users about what can be done (thanks Metin), if you have any ideas please let me know too.

I’ve setup the monitoring framework using monit, but I won’t be surprised if the factory server get clogged with simultaneous requests and you take long time to download. Please let me know if you see such downtime.

 

3DTin has been in the news this week. Checkout some stories:

Makezine: http://blog.makezine.com/archive/2011/01/3d-modeling-from-inside-a-browser.html

Shapeways: http://www.shapeways.com/blog/archives/723-3D-Tin-worlds-first-3D-modeling-tool-that-runs-in-a-browser..html

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

One Response to Export smooth models in STL and OBJ

  1. Marty McGuire says:

    Very cool that you guys are using node.js to make your browser app work like a web service!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s