Loading

Parametric two-part mold generator for OpenSCAD

by jasonwebb, published

Parametric two-part mold generator for OpenSCAD by jasonwebb Nov 28, 2012

Featured Thing!

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

Recent Comments

view all

... doh... I never changed the sample inputs folder for the sample file, but still not sure why I can't get my files to work. I think it's not centered properly.

Check that you are using the most up to date version of OpenSCAD (2014.03). I just downloaded both of the SCAD files and the sample input STL from this Thing and tested the scripts out and they work perfect for me.

Make sure the filename indicated in the model_filename variable is actually pointing to the right file in the right location. If you download the scripts and change nothing, it will be looking for your file inside of a folder called "Sample inputs", which you may need to change if you don't use such a folder.

Ok, I read through the comments to try and figure this out but that didn't help me. No matter if I am using my own STL or the sample one, when I run it through the script I just get blank boxes or cylinders with poor holes and keys but no mold. I get no errors, and in the grid only view mode I see nothing but the mentioned parts. I really want this to work and it's driving me a little crazy now. Any idea what I am messing up?

More from Art Tools

view more

Makes

Liked By

view all

Give a Shout Out

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

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.

Comments

You must be logged in to post a comment.

downgrade on Apr 19, 2014 said:

Ok, I read through the comments to try and figure this out but that didn't help me. No matter if I am using my own STL or the sample one, when I run it through the script I just get blank boxes or cylinders with poor holes and keys but no mold. I get no errors, and in the grid only view mode I see nothing but the mentioned parts. I really want this to work and it's driving me a little crazy now. Any idea what I am messing up?

jasonwebb on Apr 19, 2014 said:

Check that you are using the most up to date version of OpenSCAD (2014.03). I just downloaded both of the SCAD files and the sample input STL from this Thing and tested the scripts out and they work perfect for me.

Make sure the filename indicated in the model_filename variable is actually pointing to the right file in the right location. If you download the scripts and change nothing, it will be looking for your file inside of a folder called "Sample inputs", which you may need to change if you don't use such a folder.

JamesNewton on Mar 26, 2014 said:

So, I'm trying to use this script with this .STL
http://www.thingiverse.com/thi... (getting a jump on next Halloween)

I've repositioned it in the script::
// Model parameters
model_filename = "Celtic_Skull_Fixed.stl";
model_rotate = [90,0,0];
model_translate = [0,42,-10];
model_scale = .45;

// Mold parameters
mold_diameter = 33;
mold_height = 35;

and when I Compile, I see the indentation of the skull in the mould just as expected.

But when I compile /and Render (GCAL)/ the mold appears to be empty, and, the first time only, I get this error:

Rendering Polygon Mesh using CGAL...
CGAL error in CGAL_Build_PolySet: CGAL ERROR: assertion violation!
Expr: check_protocoll == 0
File: /home/don/openscad_deps/mxe-w64/usr/lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/include/CGAL/Polyhedron_incremental_builder_3.h
Line: 199

I saved the STL file anyway, and it doesn't appear to have any impression of the skull in it when viewed in MeshLab or Cura.

Any idea what is going wrong there? Is the skull just too complex? I get the same error if I change the script to just import the skull without using the mold script, so it must be something with the skull stl file. Wish I knew how to fix it.

jasonwebb on Mar 26, 2014 said:

Yep, you will need to work on your STL a bit. Most likely it is too complex for OpenSCAD. Under the Instructions section there is a note at the very top about how to use Meshlab to reduce the polygon count of your model for use with this script. This video may be helpful: https://www.youtube.com/watch?...

safiq10 on Jan 27, 2014 said:

Hi i'm planning on using my 3d printer to print a polyurethane wheel. Now my question is it easy to remove the mold? Also would polyurethane work? If anyone can give me a quick response that be great!

jasonwebb on Jan 27, 2014 said:

The most important factor with any mold is whether the part is designed well for the mold release process. Think about draft angles and feature thicknesses, as well as the tolerance of your casting medium (can it stand up to a little bit of bending or compression, etc.)

To release castings from your mold easily you will want to use a mold release agent. I was able to cast resin and silicone using my molds just fine using Universal Mold Release from Smooth-On, so I think I would recommend that for polyurethane. You can also try using Vaseline, if you're adventurous. Here are some notes about my experiences with resin and silicone: http://jason-webb.info/2012/12...

scottdswingle on Nov 21, 2013 said:

I'm trying to make this and everything looks correct when I compile. However, when I actually Compile and Render the blocks are gone and all that remains is the STL file. So when I export to STL, it's the same STL I already have and won't serve as a mold. I'm not sure what I'm doing wrong as this is the first time I've ever used OpenSCAD but I got the positioning setup properly.

jasonwebb on Nov 21, 2013 said:

The script assumes an STL model that is prepared as if you were going to 3D print it. In other words, centered around the the origin on the X and Y axes and sitting atop the origin on the Z axis. Open your model in ReplicatorG and hit "Move > Center" and it will take care of that for you. Inside of the OpenSCAD script you can use the model_rotate and model_transform vectors to move the model around however you need, but you must know how your model is oriented to begin with.

Also make sure that the model is correctly sized (not too big or too small). Again, opening it in RepG should give you some sense of if it is too big or too small to be visible.

If OpenSCAD is new to you, I recommend looking at some other scripts and understanding what is going on. I wouldn't classify this script as beginner-friendly, but you can learn a lot from it. Start by making a new script and typing in import("yourmodelname.stl"); and compiling that. You can then use the rotate, transform and scale functions to tweak the model. Try making a cube that encloses your model perfectly. This should help you understand how this script works.

alexmigraz on Sep 4, 2013 said:

This is very cool. I have experience in silicone molding. i think these techniques to make the mother mold, vents etc, and then being able to pour in silicone blanket mold will be very interesting.

fcgccmar on Jul 26, 2013 said:

Great job! It is awesome and work perfectly! Thanks a lot for your contribution.

masxyz on Jul 3, 2013 said:

thats fantastic, amazing, astonishing. wow super

masxyz on Jul 3, 2013 said:

Many thanks for sharing. excellent

Henkka on Apr 2, 2013 said:

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/...

jasonwebb on Apr 2, 2013 said:

That's really awesome! Thanks for sharing!

jon_bondy on Jan 12, 2013 said:

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)?

jasonwebb on Jan 12, 2013 said:

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.

owenscenic on Jan 10, 2013 said:

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

jasonwebb on Jan 10, 2013 said:

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

marcelopasqua on Jan 6, 2013 said:

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 :)

jasonwebb on Jan 6, 2013 said:

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.

Tommydag on Dec 14, 2012 said:

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!

Lincoln on Dec 11, 2012 said:

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

jasonwebb on Dec 11, 2012 said:

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) :)

Andrew1618033 on Dec 1, 2012 said:

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!

jasonwebb on Dec 1, 2012 said:

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.

dreameredeemer on Nov 29, 2012 said:

*oblig* IT'S A TRAP!

yzorg on Nov 29, 2012 said:

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.

jasonwebb on Nov 29, 2012 said:

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.

EricYoung on Nov 29, 2012 said:

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

3DTOPO on Nov 28, 2012 said:

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.

jasonwebb on Nov 29, 2012 said:

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... :)

jedynak on Nov 28, 2012 said:

Genius !

johnbiehler on Nov 28, 2012 said:

This is extremely awesome! Thanks for the detailed post!

Top