MakerBot models 5486

MakerBot models built with code included with the ModelBuilder library, also downloadable from my Thingiverse account

Update, March 16, 2012: New Modelbuilder build (0020) released, containing minor fixes and some less-than-well documented experimental features (UApp, UAppSketch). Biggest news is the UMovieMaker sub-lib, which provides a replacement for Shiffman’s MovieMaker library that was discontinued for Processing 2.0b.

UMovieMaker is distributed separately from the main Modelbuilder lib and uses the Monte Media Library by Werner Randelshofer. The lib matches MovieMaker’s syntax and provides Quicktime export without dependencies on Apple’s flaky Quicktime for Java. See included examples for typical uses: UMovieMaker-001.

Update, Feb 25, 2012: Modelbuilder is now hosted on Github: https://github.com/mariuswatz/modelbuilder. See the post about the updated README for information abouth Processing 2.0 beta compatibility.

Update, June 21 2012: I have started an OpenProcessing Modelbuilder collection of sketches. Watch that space for new demos or submit your own…

Update, June 14 2012: Revised Modelbuilder-0007a03 with source and new examples now on Github: modelbuilder-v0007a03.zip

Update, May 24 2012: Modelbuilder-0007a03 with complete source and new examples is now on Github: modelbuilder-v0007a03.zip

Update, April 24 2012: Modelbuilder-0007a01 with complete source and new examples is now on Github: https://github.com/mariuswatz/modelbuilder. Download the exportded/modelbuilder-0007a01.zip for the latest version packaged and ready for use in Processing (1.5.1 only…)

Update, July 1 2011: I’ve uploaded ModelBuilder v0004, which fixes a few really silly bugs in 0003. Download it from http://code.google.com/p/codeandform/.

I’m happy to announce the first public release of my new ModelBuilder library, created as part of my artist-in-residence project at MakerBot Industries and beta tested in the Interactive Parametrics workshop. The occasion for today’s release is the MakerBot User Group New York, where I’ll talk about the library and show off my MakerBot models.

ModelBuilder focuses on functions useful for digital fabrication purposes, such as creating meshes, centering models around origin, scaling to given dimensions, output to STL format etc. It emulates Processing’s beginShape / vertex / endShape logic to build mesh geometry which can then be manipulated and transformed.

The UVertexList class allows the user to build paths of vertices. Vertex lists are then fed into various UGeometry.quadStrip() functions to construct quad strip meshes, most likely eliminating the need for dozens of for loops in the process. See the online copy of the ModelBuilder JavaDoc for a more complete overview.

Coders using the library to output models for 3D printing need to be aware of face orientation (see Wikipedia: Handedness) so that face normals are generated correctly.
Always check models to see if face normals are correct before attempting to 3D print them. As always, I recommed the Open Source tool MeshLab for previewing and testing models. MeshLab will render backwards-facing faces as all black, giving an easy preview of incorrect geometry.

Happy mesh building, look forward to seeing models on Thingiverse!

Download

Download modelbuilder-0004.zip and unpack it. Copy the “modelbuilder” folder to your “libraries” folder and restart Processing. If you have the now obsolete unlekkerLib installed you should remove it before adding ModelBuilder, which effectively replaces unlekkerLib.

The ModelBuilder library folder includes (rudimentary) JavaDoc documentation, the library source code and a series of examples located in “modelbuilder/examples”. The most advanced example is mb_04_gui_parametric, which contains the code used to create MakerBot prints shown above. The “gui” examples use Andreas Schlegel’s ControlP5 library, which must be downloaded and installed before running them.

This should be considered an experimental in-progress release and some features are likely to change. As usual, niceties like good documentation have been left for last, so the best way to get a feel for the library is to run through the examples provided. Bug and / or success reports are welcome, just leave comments on this post.

30 Comments »

There are 30 comments to "Code: ModelBuilder library – first public release". You may leave your own comment.
1. Andreas, April 7th, 2011 at 07:04

hi marius, excited about the modelbuilder lib, gave it a try and ran through the examples. i got some erros when first running it though. hunting down the causes told me that there is a conflict of interest with having both the modelBuilder and the unlekkerlib (latest version for me) installed at the same time. i removed the unlekkerlib and everything was running smoothly. just in case this happens to someone else, too.

2. marius watz, April 7th, 2011 at 08:29

Hi Andreas, happy to hear you’re testing the new lib. I’ve been using your controlP5 as a GUI component for parametric modelling.

unlekkerLib might give conflicts, but it should be considered obsolete as of this release so you can safely delete it from your libraries folder. If there’s any functionality you miss from the old unlekkerLib please let me know, although I can’t imagine anything that’s not done better by either the new library or toxicLibs etc.

My version of the TileSaver function has been broken for a long time now, I use Karsten’s version myself…

3. Final Project: “Make or Cut” | Chexee in a few words., May 5th, 2011 at 17:04

[...] created shapes using Mariuz Waltz’s ModelBuilder Library examples that were proportionally based on the recent budget cut proposal to NSHE. In this [...]

4. phil jones, May 31st, 2011 at 17:27

Hi Marius,

Just downloaded your library. Great! Exactly what I needed to make my exhibition next week. (Was going a bit mad trying to turn default Processing DXFs into STLs.)

Looks like the exhibition is saved, many thanks to you.

regards

phil

5. Tutorial: The ModelBuilder Library For Processing & 3d Printing | RJ Duran: Hybrid Media Technologist, August 31st, 2011 at 03:31

[...] this tutorial I will introduce you to the world of 3d Printing and Processing using the ModelBuilder library by Marius [...]

6. fire blanket, September 13th, 2011 at 23:58

Excellent post with interesting comments. I will be watching for new comments

7. Norman Patrick, September 28th, 2011 at 15:33

Norman Patrick
_________________________________________

Fire Blanket | Fire safety | Cash collection trolley

8. asobu, December 20th, 2011 at 06:45

Hi Marius,

I have some enquires with regards to the importing and exporting of the .stl file format.

I am currently creating a GUI whereby I need to import a .stl file into the canvas.

I have read the javadoc and it is clear that I needed to use this particular constructor:

Public STL (processing.core PApplet applet, java.lang.String path)
{
path = “url”;
}

However, I always got an error.

If it is at all possible, could you upload a simple example on import .stl file into the canvas of GUI?

Thank you very much!

Best Regards,
asobu

9. marius watz, January 17th, 2012 at 15:57

The current Modelbuilder library doesn’t support reading STL, only export, so I’m not sure where you’re getting that constructor from. Can you provide a little more context for the code you’re using?

I will be posting a Modelbuilder update in the next few weeks, and that will include STL import.

10. Art Hack Day, generative, ScratchML, Makerbot, fabrication | Culture Hacking, January 31st, 2012 at 07:39

[...] a design for one of the Makerbots donated to the event, an open-source 3d printing machine. Using Marius Watz’s model-building library for Processing, I created a program which transcodes a song into a 3d representation of its [...]

11. asobu, March 7th, 2012 at 06:04

Marius,
I found this constructor in the following url:
http://workshop.evolutionzone.com/files/unlekkerLibDoc/unlekker/data/STL.html
thanks:)

12. We Coded, Drank & Conquered, (Model Builder amongst other things). : Free Art Bureau, April 18th, 2012 at 19:52

[...] on a variety of approaches and tools from generative systems and interactive worlds to the great ModelBuilder and Box 2D libraries to name but a few. When you give these systems to a culturally and [...]

13. Ari, May 24th, 2012 at 03:19

Hello,

I downloaded your finals, but I get these errors:

No library found for unlekker.util
No library found for unlekker.modelbuilder

What should I do?

Thank you for sharing your work.

14. marius watz, May 24th, 2012 at 08:21

Hi Ari, did you download the most recent version? Try this: modelbuilder-v0007a03.zip. As always you need to put the “modelbuilder” folder inside “libraries” inside your sketchbook.

Are you using Processing 2.0a? I haven’t upgraded Modelbuilder to that version yet.

15. stephan schulz, August 22nd, 2012 at 03:19

this library sounds great.
i got this error: Exception in thread “Animation Thread” java.lang.NoSuchMethodError: controlP5.ControlP5.setMoveable(Z)V
i’m using processing 1.5.1 and controlP5 0.7.5
any ideas what i am doing wrong? thx.

16. marius watz, August 22nd, 2012 at 17:54

Sorry about that, Modelbuilder is built on controlP5 0.5.4 for now. I plan to do a bigger migration when I update everything to work with Processing 2.0.

17. stephan schulz, August 22nd, 2012 at 19:51

thanks that works now.

18. amanda, December 2nd, 2012 at 21:00

hi marius,
thanks for posting this library it is seriously awesome! Right now I’m using it to export some incredibly detailed STL files. everything works great when I turn the resolution down, but when I run my code at high resolution it starts but eventually causes java to stop responding. The largest file I’ve been able to export successfully had about 2,800,000 faces (which is fantastic, but not quite enough for what I’m trying to do). I’m not exactly sure what’s happening, maybe the UGeometry object has run out of space? maybe processing’s buffer has run out of space? the crashing happens before the writeSTL command executes, while I am still generating vertices and storing faces in the UGeometry object. there is no error code. what do you think? can you think of a way to export a bigger file?
thanks!
amanda

19. marius watz, December 4th, 2012 at 09:57

Hi Amanda, sorry for your trouble. For what it’s worth, anything over 1M faces is a lot of geometry and you’ll likely have trouble working with any files you export. But if you don’t get any errors I’d suggest increasing Processing’s memory in Processing Preferences. Does the Processing IDE crash or just your sketch?

ps. Curious to see what you’re exporting. Links?

20. amanda, December 4th, 2012 at 15:09

hi,
thanks for the info, yeah I’ve realized that this is a limitation of processing/my machine and not the library. I messed around with processing’s memory a bit and managed to get some files out with up to 7.2M faces (pretty amazing!). I think if I want to get bigger files out I will just have to use a more powerful machine (I’m using a laptop currently). I will definitely send you a link when i post my project! printing out my first test tomorrow…

21. amanda, December 20th, 2012 at 17:54

http://www.instructables.com/id/3D-Printed-Record/
3d printed record, built with the modelbuilder library!

22. 3D Printed Record – 600dpi into 11kHz with Processing and ModelBuilder @ refresh.in.th, December 21st, 2012 at 17:02

[...] using Processing, ModelBuilder Library by Marius Watz and a 3D printer, Amanda Ghassaei at instructables managed to print a [...]

23. Amanda Ghassaei-3D Printed Record *Convert MP3 Onto Vinyl « Rugged Ones, December 21st, 2012 at 20:26

[...] used for coding interactive graphics applications.  To get Processing to export to STL, I used the ModelBuilder Library written by Marius Watz (if you are into Arduino/Processing and 3D printing I highly recommend [...]

24. 3D Printed Record by amandaghassaei » Hallo, here is Pane!, December 29th, 2012 at 07:55

[...] in the last step as an STL file.  To get Processing to export straight to STL, I used the ModelBuilder Library written by Marius Watz (if you are into Arduino/Processing and 3D printing I highly recommend [...]

25. MAKE | Turntable Spins 3D Printed Record, December 31st, 2012 at 22:02

[...] Amanda took the audio files and ran them through a Python script that generated discrete values. She then took those values and plotted them in a Processing sketch as thousands of triangular slices nestled into a spiral groove. The variations in the size of these triangles are what ultimately translate to the audio that’s picked up by the phonograph needle. The 3D file was exported from Processing in STL format using the ModelBuilder Library. [...]

26. Turntable Spins 3D Printed Record, January 1st, 2013 at 02:37

[...] Amanda took the audio files and ran them through a Python script that generated discrete values. She then took those values and plotted them in a Processing sketch as thousands of triangular slices nestled into a spiral groove. The variations in the size of these triangles are what ultimately translate to the audio that’s picked up by the phonograph needle. The 3D file was exported from Processing in STL format using the ModelBuilder Library. [...]

27. 3D Printed Records: We Talk to the Creator About Her Work, 3D Printing Potential | Dorchase, January 7th, 2013 at 20:20

[...] lots of room for experimentation and complexity. You can read about it and download it here: http://workshop.evolutionzone.com/2011/04/06/code-modelbuilder-library-public-release/ and here’s a collection of Processing sketches that use the library- I’ll be adding [...]

28. How to use Processing with Modelbuilder to generate STL | Funbie Studios, March 27th, 2013 at 15:09

[...] Written in Java, it is an open source tool available for download for free. On the other hand, Modelbuilder is a library for use with Processing. This library is created by Marius Watz. If you are not sure [...]

29. Jaakko Talonen, March 27th, 2013 at 16:14

Hi and thanks! Your library is so great. Here at Aalto University we used modelbuilder in Nokia 820 Hackathon, check out our work results here: http://www.thingiverse.com/haques/collections/square-parts

30. 3D Printed Records: We Talk to the Creator About Her Work, 3D Printing Potential | Uber Patrol - The Definitive Cool Guide, May 4th, 2013 at 19:35

[...] lots of room for experimentation and complexity. You can read about it and download it here: http://workshop.evolutionzone.com/2011/04/06/code-modelbuilder-library-public-release/ and here’s a collection of Processing sketches that use the library- I’ll be adding [...]

Comment on this entry

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>