Parametric two-part mold generator for OpenSCAD

3400
Downloads
50814
Views
Published on November 28, 2012
This thing was Featured on November 29, 2012

Description

A set of parametric OpenSCAD scripts that generate ready-to-print two-part molds from arbitrary STL models.

These scripts can be used to generate either **square** (with or without rounded corners) or **circular** two-part molds and are fully parameterized to make it easy to adapt for your application.

Refer to the instructions below for some general tips, as well ideas for casting.

I have successfully made casts from these molds using wax, Knox gelatin, Oogoo and chocolate. If you have success with other casting media, please leave a comment!

Many more pictures of molds and castings I made with these scripts:
flickr.com/photos/zenwebb/collections/72157631531182783/

If you'd like to read about the development process for these scripts, and learn from some of the issues I came across, check out:

- jason-webb.info/?p=4741
- jason-webb.info/?p=4892

If you really want to bring your molds to the next level, you can even try the "lost ABS" (or lost PLA) process to turn it into metal: jason-webb.info/2012/11/lost-abs-experiment-with-3d-printed-objects-and-aluminum-casting/

I have also uploaded a parametric open-face mold generator to create positive and negative molds: thingiverse.com/thing:32657

Instructions

**Prepare a model to create a mold from**
To create a two-part mold using these scripts, you first need to prepare an STL model of your choice. OpenSCAD has some performance limitations when it comes to loading external STL files, so keep your polygon counts as low as you can. I like to use Meshlab's "Quadric Edge Collapse Decimation" filter (under the "Remeshing, Simplification and Reconstruction" section) to reduce the number of faces in more complex models to get them to load in OpenSCAD.

Avoid undercuts and overhangs in your model, as this mold-making process doesn't really allow for that.

**Using the scripts**

1. Download one of the .scad files and open it in OpenSCAD.
2. Update the parameters in the script to point to your model, as well as transform it to be suitable for printing.
3. Compile and Render (F6) the script with your updated parameters.
4. Grab an STL using the "Design > Export as STL" tool.

**Guide to parameters**

* _Model parameters_ - external STL model to build mold around. Use the rotation, translation and scale parameters to orient your model relative to the mold.
* _Mold parameters_ - attributes of the mold itself. Make it any size you want, and turn on or off rounded corners to help with printability.
* _Key parameters_ - attributes of the registration marks to get the halves to fit together well.
* _Pour hole parameters_ - attributes, translation and rotation of the pour hole so you can get material into the mold. This can be tricky, so take your time to experiment.

**Slicing your mold**
In my experience, the resulting OpenSCAD models are very tolerant of a wide range of slicing settings. I like to keep the infill down around 20%, and opt for only 1 shell, if any. A layer height of around 0.15mm works well for me. Larger layer heights can result in gaps in the inner mold form which can make it more difficult to cast.

**Printing your mold**

1. Be sure to seal your bot against drafts if using ABS. I faced a lot of layer separation issues in the beginning.
2. Make sure your build platform is level! If its not, you may see bowing or warping in your mold.
3. Accurately measure the diameter of your filament and update it your slicing engine. I experienced some pretty severe delamination / layer separation issues on the outer walls of my early molds before I did this.

**Finishing your mold**
Depending on slicing settings, you may end up with a mold that is not completely watertight. I had small gaps in some of my molds that let water seep into the mold form and made it hard to cast anything. A quick spray or brushing of polyurethane fixed that right up for me, but obviously this makes any kind of food casting a bad idea.

**Using your mold**
After applying a release agent, use wood clamps or strong rubber bands to hold the two mold halves together. If needed, apply modeling clay to the seam just to be sure that nothing leaks out.

**Casting tips**
I have had very good success with using Knox gelatin to create flexible casts from my molds, but that is by no means the extent of what can be used. Here is a short list of ideas to try:

- Knox / Jell-O gelatin
- Ice
- Hard candy
- Chocolate
- RTV silicone (try Oogoo)
- Plaster

Try holding a small popsicle stick right in the middle of the pour hole during casting to create fun lollipops and chocolate treats!

**_DISCLAIMER_**
Don't try to consume any of the castings you produce from these molds! The food safety of ABS / PLA is not really clear, so please just try to use these molds for experimentation, rather than food production.
Tags
Report as inappropriate

You must be logged in to post a comment.

Thanks, this worked great when we did some candle wax castings with my son. I blogged a bit about this in http://random3d.wordpress.com/...

That's really awesome! Thanks for sharing!

When I try it with your example STL file, it works fine, but when I try it with my STL files, it never works. Any hints about how to position the STL file with respect to the mold? Is there any way to see where my STL file is in relationship to the mold (in case it is inside, or way outside of the mold)?

Make sure that the physical dimensions of your STL object aren't too much bigger or smaller than the dimensions of the mold. Also, the script assumes that your object is centered on the X and Y axes, and sitting atop the Z plane, just like it would be in ReplicatorG.

After using "Compile and Render", switch to View > CGAL Grid Only and see if your mold has any alterations inside it.

If you still can't find it, add an extra import(model_filename); in different parts of the modules within the script. If you want to just have it show up on its own, it must not be inside of any difference() blocks. You'll probably need to apply the model_translate and _rotate vectors, because that is how the import function is used everywhere in the script.

You can use the model_rotate and model_translate vectors to position your STL after you've located it.

Can this be combined with the new customizer feature of Thingiverse? THat would be so cool.

You know as much as I do! Never heard about this customizer thing until yesterday, and I still don't know what the heck it is. If I could just upload a special OpenSCAD script and tell Thingiverse which parameters to break out, I'd do it in a heartbeat. But right now, it looks like I'd have to spend a few weeks at least figuring out the API and developing a program from scratch. No thanks :P

Hello Jason!

Thanks for sharing this with us.. I just having a noob problen :/

When you say;

"2. Update the parameters in the script to point to your model, as well as transform it to be suitable for printing."

On this printscreen (link) it shows where I put my location, but is not working. ;/

http://goufactory.com.br/wp-co...

And should I install the Openscad in any special place?

Alsto when I load the "square-two-part-mold-generator.scad" and press F6, it says that was impossible to load "Sample inputs/sample-input.stl""

Sorry for this amatuer question, I really don't understand codes :P

Thanks anyway :)

If you didn't get any errors during compiling, your object may be there without you seeing it. Use View > CGAL Grid Only to see a wireframe representation of the mold. Maybe your object is inside the mold block, and you just can't see it.

Also, I find that its easiest to have the SCAD file in the same directory as the STL file, just so I don't have to write out the whole path.

You will get an error if you try to run my code, unless you have your own STL named sample-input.stl in a folder named Sample inputs. Just change the filename to point to your own model, and you'll be fine.

OpenSCAD is not a very easy program to start with, so I would try learning the basics of OpenSCAD User Manual (http://en.wikibooks.org/wiki/O... and the included examples before attempting to do more advanced stuff.

Great thing!  On the topic of a release agent, the experimental vehicle team I am on uses a spray form of PVA that is purple and works really well for epoxy resin release. I can't remember it's name but I am sure it's easily googled. Keep up the good work!

Have you ever tried casting resin in one of these?  I'm wondering if it would fuse to the ABS.

I do have some casting resin that I was planning to try when I get a chance. It would be very important to use a good release agent with resin to prevent fusing. I've heard of using cooking spray, as well as Universal Release Agent from Smooth-On. However, if worse comes to worse, you can still drop the mold in a jar of acetone and dissolve the mold, leaving the resin casting behind (maybe) :)

http://www.ncbi.nlm.nih.gov/pu...
"It is concluded that PLA is safe and 'Generally Recognized As Safe' for its intended uses as a polymer for fabricating articles that will hold and/or package food."

Just don't use ABS!

Great post!

Unfortunately, food safety is just not a cut-and-dry topic. The link you provided doesn't work for me, but there are several sources on both sides of the issue. Food safety involves not just the molecular structure of the material, but also its application and handling. In short, no material is 'food safe' if its handled incorrectly. The real question is, how does one handle ABS safely?

The Thingiverse blog has some good info on the topic here: http://blog.thingiverse.com/20...

Also check out this discussion at the RepRap forums: http://forums.reprap.org/read....

My recommendation is to use whatever you are comfortable with, but take personal responsibility for your own safety.

I used spray butter as a release agent when casting with gelatin and chocolate. I consumed the results and didn't die. Is it categorically 100% safe? Who knows? There are still people who say that the fumes put off by ABS/PLA during the printing process are harmful, so you really have to make your own judgement.

*oblig* IT'S A TRAP!

how did you manage to get that general akbar trough openscad?
i cant even compile data with half the detail.. crushes all the time.

i want make molds from my devilhead stl.
http://www.thingiverse.com/thi...
i even reduced its polygon amount and its just 1.5 mb now.
this is a part i printed a few times and i got no problems slicing it.

i intend to fill the mold with silicone so the small overhangs shouldnt be a problem.

OpenSCAD has some pretty severe limitations when it comes to loading external files, among other issues :S I took the model and ran it through Meshlab's Quadric edge collapse several times. I basically would run it once, save it and try it in OpenSCAD, then repeat until it loaded. The resulting size of the Ackbar model was about 400kb, and only has about 9000 faces.

You'd be surprised at how few faces you can get away with and still have a perfectly good-looking model! Especially when you consider that the more you scale down your object / mold, the less detail you'll actually see anyway.

Really nice job on this, thanks for all the detail :)

Hey there - nice work! I am the one that did the lost PLA that ABS casting links to (and apparently was what inspired him).

Note that for lost PLA/ABS casting you actually want a mold positive, not a mold negative.

That said, you could use a mold negative to create wax copies that could be used with the traditional lost wax process. The nice thing about that is it is much faster to create a wax copy from a mold then it is to print a new one out of PLA/ABS.

Thanks! Great work, I really enjoyed your writeup on lost PLA.

I would say it really depends on what the intended use of the mold is. I didn't do sand casting, just investment casting, and it seemed to me that it could handle positives or negatives just fine. I happened to have more than a few test molds from this script laying around, so I gated one up just to see if it burned out in the kiln well. 

I'd say there are advantages to casting a mold negative in metal. For example, with aluminum you may be able to achieve consistent food-safe results, and be able to clean it more easily. 

I also did lost ABS on some objects that were not molds and cast in bronze - but I'm still working on finishing them. Lots of photos here http://www.flickr.com/photos/z... :)

This is extremely awesome! Thanks for the detailed post!

Remixes

Liked by

Give a Shout Out

If you print this Thing and display it in public proudly give attribution by printing and displaying this tag.

More from jasonwebb

More from Art Tools