OpenSCAD Quick Tip: Support Pegs

Skeinforge has the ability to automatically create support meshing that comes away comparatively easily with a pen knife, but at some point it starts to feel less like printing and more like whittling, and while soluble support structures are less far off than they once were, if you’re like me you’ll still find yourself looking around for a more elegant solution.

Enter the support peg.

The idea is to basically extend a vertical support peg through your model, allowing the fairly common practice of bending or breaking the “45 degree rule” to stretch a little farther than it usually does.  For my example I’m going to use this adorable but tough-to-print stegosaurus model:

The body could use a little support, but the big trouble will be the head and tail, which on a 3D printer without support material will have undersides coated with strands, and may cause some “pull-up hazard”, meaning that the strands might get caught on the print head and yank the model off the build area.  So let’s get this file into OpenSCAD, which I’ve found is a great tool for putting posts into models because of its solid geometry tools.

I recommend you put the file in your OpenSCAD installation directory for now, although some people like to have a separate directory for the files.  Either way, make sure you have the whole path to the file for the next step, starting your OpenSCAD file.  (If you’re still new to OpenSCAD you might want to check out my getting started tutorial or even try the big list of them.)

import_stl("/home/allan/Downloads/dinosaur.STL");

(I found that for some reason I had to open this file in Blender and re-save the STL to get OpenSCAD to like it.  This might be due to some non-uniformity with how STL is implemented and is an example of why it’s good to know at least the basics of a few tools. I also rotated and translated it so it was sitting upright on the origin.)

Now you’ve got it in OpenSCAD you should get a picture like this:

With that done I started in with the pegs.  Each peg is a “cube” object stretched into a thin post and unioned onto the dinosaur:

union()
{
import_stl("/home/allan/Downloads/dinosaur.STL");
translate([-45,0,-37])cube([3,3,100],center=true);
translate([-35,0,-35])cube([3,3,100],center=true);
translate([-55,0,-35])cube([3,3,100],center=true);
translate([-25,0,-35])cube([3,3,100],center=true);
}

Now the dinosaur has long posts coming down out of its neck.  At 3x3mm, they should snap off fairly easily, but they extend a long way down past the feet.  This is intentional, because I’d rather use my next trick to get them exactly the same height as the feet, and simultaneously make the feet a little flatter.  Intersection!

The bit of code I’m adding uses the intersection operator to cut off the bottoms of all the pegs– and just a little bit off the dinosaur’s feet!  I basically did this by typing in numbers, hitting F5, and then doing it again until I had the height *just right*:


intersection(){
union(){
import_stl("/home/allan/Downloads/dinosaur.STL");
translate([-45,0,-37])cube([3,3,100],center=true);
translate([-35,0,-35])cube([3,3,100],center=true);
translate([-55,0,-35])cube([3,3,100],center=true); translate([-25,0,-35])cube([3,3,100],center=true);
}
translate([0,0,23])cube([290,60,60],center=true);
}

The new version of the STL should print much more smoothly!

7 Comments »

  1. paul Said,

    November 22, 2011 @ 8:33 am

    Is there a reason you do an intersection rather than a difference with a block extending below your figure?

  2. Allan Ecker Said,

    November 22, 2011 @ 11:27 am

    Guarantees there will be no pieces that extend past the blocking cube, although that’s correctable just by picking a very large value for the size of the cube below the figure.

    It’s a style thing, either way should work equally well, and intersection might “behave” better with the renderer, as I’ve seen the intersection result in funny preview renders…

  3. paul Said,

    November 22, 2011 @ 4:10 pm

    Thanks. Makes sense as a style/safety thing. I’ve also noticed some interesting issues about differences taken in the wrong way…

  4. Kliment Said,

    November 23, 2011 @ 4:19 am

    That’s exactly what I did to support my octocat. See the little support cone under the bent tentacle at http://koti.kapsi.fi/~kliment/octocat/octocat.scad.png (remove .png for source code). I’ve gotten best results by having the support end exactly one layer thickness before the model starts.

  5. Dan Said,

    November 24, 2011 @ 7:38 pm

    OK… this is an interesting idea. Can you show the model after the support pegs were added? How well did your choice of peg placement work out in the actual print? What did you earn regarding the ideal placement of the pegs in your experiments? Thanks for any additional details!

  6. Brictone Said,

    November 27, 2011 @ 6:28 pm

    Is there a screen shot of what this looks like after the pegs have been placed?

  7. Dustin Andrews Said,

    December 1, 2011 @ 12:14 pm

    If I were to print this again, I would use Openscad to slice it into 3 sections. Legs, body left and body right. Then just glue them together. I have gotten great results with models that won’t print well any other way.

Leave a Comment