Making 3D prints with OpenSCAD, Poser and Shapeways.

As you might know, I’ve played for years with Poser Pro now. And for about a year, I have created printed models through the services of Shapeways while also creating all kind of artwork with those Poser models and E-ON Vue. But more recently (well, less than a week ago) I started experimenting with OpenSCAD, which is an open-source CAD application where you just “program” a special script file and it will generate a 3D model for you based on that script.

So, to start I will show you how I created a special box for my electronic experiments, which is my Shapeways model. It is a rectangular box with five holes in the side for wires that lead to a small, round container. Not sure what I want to build inside it, but I just like the shape and it is a nice experiment to start with.

This is a box with two different lids. One round, one rectangular. The rectangular lid will also contain a small engraved text.

To start, I create a simple module to create the lid:

module BoxLid(width, height, depth, groove){
    union(){
        cube([width, height, depth/3]); 
        translate([groove, 0, depth*1/3])cube([width-2*groove, height-2*groove, depth*1/3]);
        translate([groove/2, 0, depth*2/3]) cube([width-groove, height-groove, depth*1/3]);
        translate([width*6/20, groove*1, -depth*1/3]) cube([width*8/20, groove/2, depth*1/3]);
        translate([width*7/20, groove*2, -depth*1/3]) cube([width*6/20, groove/2, depth*1/3]);
        translate([width*8/20, groove*3, -depth*1/3]) cube([width*4/20, groove/2, depth*1/3]);
    }
}

This set of cubes will create the lid that will slide in a special slot that we will add to the box. The first three cubes are of various sizes and create a groove to slide over. The lid will completely cover the side of the box.

The last cubes are used to put some relief on the lid to allow it to slide easier up and down. But I want to have it engraved with some text, so I create an engraving module:

module label(name, depth, fontSize){
    linear_extrude(height = depth) {
         text(name, size = fontSize, font = "Lucida Calligraphy", halign = "center", valign = "center", $fn = 50);
     };
}

And I need a second module for the lid including the engraved name:

module NamedBoxLid(width, height, depth, groove){
    difference(){
         BoxLid(width, height, groove, groove);
         translate([width/2, height/2, groove/2]) rotate([0, 180, 270]) label("Team Katje", groove, 8);
     }
}

Yeah, engraving is just that simple! Subtract the shape of the text from the shape of the lid. The most tricky part is actually trying to rotate it and making it fit. But it also tells us how we can create a box. We basically make a box and subtract the lid from it! I will also subtract 6 cylinders from a side for the holes to the round box on the side. And we will also subtract the inner space from the box so it has space:

module Box(width, height, depth, groove){
    difference(){
         cube([width, height, depth]);
         union(){
             translate([groove, groove, groove]) cube([width-2*groove, height-2*groove, depth-2*groove]);
             translate([width*1/5, groove*3/2, depth/2]) rotate([90, 0, 0]) cylinder(h=groove*2, r=groove*2, $fn=precision);
             translate([width*4/5, groove*3/2, depth/2]) rotate([90, 0, 0]) cylinder(h=groove*2, r=groove*2, $fn=precision);
             translate([width/2, groove*3/2, depth*1/5]) rotate([90, 0, 0]) cylinder(h=groove*2, r=groove*2, $fn=precision);
             translate([width/2, groove*3/2, depth*4/5]) rotate([90, 0, 0]) cylinder(h=groove*2, r=groove*2, $fn=precision);
             translate([width/2, groove*3/2, depth/2]) rotate([90, 0, 0]) cylinder(h=groove*2, r=groove*2, $fn=precision);
             BoxLid(width, height, groove, groove); 
         }
     }
}

Or actually, I combine the five holes, the box content and the lid together into a single shape and subtract the whole shape from the box. This way, I know the lid will fit perfectly on the box.

All I have to do now is create the second, cylindrical box on top of the holes. For this, I again start with creating a lid:

module CylinderLid(width, groove){
    union(){
         cylinder(h=groove, r=(width-groove*2)/2, $fn=precision);
        translate([0, 0, groove])
         difference(){
             cylinder(h=groove, r=(width-groove*2)/2-groove, $fn=precision);
             cylinder(h=groove, r=(width-groove*2)/2-groove*2, $fn=precision);
         }
     }
}

Again, a simple procedure of stacking two cylinders on top of each other. However, to make slightly more room, the smaller cylinder is hollowed by subtracting an even smaller cylinder. The result is a ridge to keep the lid in place.

And like the box, I will subtract the cylinder lid from a hollowed cylinder:

module CylinderBox(width, height, groove){
    difference(){
         cylinder(h=height, r=(width-groove*2)/2, $fn=precision);
         union(){
                 CylinderLid(width, groove);
                 translate([0, 0, groove]) cylinder(h=height-groove, r=(width-groove*2)/2-groove, $fn=precision);
         }
     }
}

Now I know that the cylinder plus lid will be exactly the proper height together. All I have to do now is put them all together:

width=40;
height=80;
depth=width;
groove=2;
cylinderhight=12;

Box(width, height, depth, groove);
translate([0, 0, depth+3]) NamedBoxLid(width, height, depth, groove);
translate([width/2, groove, depth/2]) rotate([90, 0, 0]) CylinderBox(width, cylinderhight, groove);
translate([width/2, height/2, depth+10]) rotate([180, 0, 0]) CylinderLid(width, groove);
translate([width/2, height/2, depth]) cylinder(h=10, r=1, $fn=precision);

I first specify the sizes for the box in millimeters. It will be 4x4x9.2 CM in size, which is large enough for a 9 volt battery plus holder, some wires and maybe some other stuff.

Next, I create the box at the standard location. Above the box, I put the lid, with some space in-between to keep them separate. The cylinder is put against the box itself around the holes but the lid for the cylinder is put on top of the lid for the box itself.

The last thing connects the box and the two lids to make it all a single part. On Shapeways, you have to pay extra if it is all separate parts so make sure you connect it all together with thin connectors that you can easily cut away with a sharp knife. And yes, I checked to make sure it doesn’t go through the line of text on the lid!

Now, what does it all look like? Well, just look at these images:
LidBoxCylinderLidBatteryBox

It is all quite easy to do, although it requires plenty of math to get things in the proper locations. I haven’t explained the math part and I won’t. I’m just showing what you can do with OpenSCAD and a few hours of free time.

The result is a .STL file that you can upload to Shapeways to have it printed. As an alternative option, you can also convert it to an .OBJ file format and import the box into Poser, and add a Poser model on top of the cylinder lid, just for fun.

Or you will add textures to the shape and use it in Poser/Vue to create some new image. It can be even more interesting if you can combine a 3D printed model together with a rendered image of the same model.

I still have a lot to learn about OpenSCAD but this tool allows you to specify exactly the shapes that you want for your 3D model and allows you to create modules that will allow you to do some complex things like separating a lid from a box.

Shapeways 3D printing

Well, as you know, I like making 3D images. But nowadays there’s also an option of making 3D prints. You can do this with your own 3D printer or you’ll use the services of a company like Shapeways.

Personally, I want to experiment with my own 3D printers but finding a good one isn’t easy. On KickStarter, I found Tiko, the unibody 3D printer which looks great! So I supported it since I want one! It is now funded so they are working on creating it and then shipping it so I have to be patient before I can 3D print myself. And I’m not patient!

So I have experimented with Shapeways, which is fun. And my first experiments failed mostly. I noticed several interesting challenges because 3D printing and 3D rendering are two completely different things. Take, for example, this model that I’ve called Bianca:
Bianca Delmonde with Sword_0001

A nice bikini model wielding a sword and something I really would have liked in color. Unfortunately, Shapeways does offer color printing but the details on this model are too fine for this. They have colored sandstone and colored plastic. Unfortunately, sandstone is brittle during printing and the model might fall apart during handling. Full-color plastic is better but requires a minimum thickness of some parts and there’s a size limitation. The largest size allowed for this model resulted in too many thin walls. So I decided to go for strong, white plastic instead:

DSC04983

The drawback of white plastic is that I now have to paint it myself. Which is okay, since the print was perfect. Even her sword came out nicely. Only the bikini bottom had a flaw, since at one point of her backside, there’s a hollow area because the material was too thin. But hey, it looks funny so I don’t mind. 🙂

Still, I wanted a colored 3D print so I experimented a bit and decided to use this dinosaur as a model:

Zuniceratops_0001

And I kept it just simple so I can experience what the material would look like. But also, it allowed me to see how well the sandstone can handle pointy, short things. And the result looks great:

DSC04972

Okay, not my finest picture but the result looks good. The sandstone glitters a bit, though. But the horns are great and the print was perfect, except for a broken toe. That’s basically a flaw that can happen with the chosen material.

There are many other materials to choose from, including metallic plastic and even expensive metals. But printing in those materials is complex and requires shapes with thicker walls and fewer details. Printing in gold is also very expensive because, gold! You don’t want to have big, gold models unless you have a big wad of money available.

For 3D printing, various techniques are used. The technique generally depends on the material used. Shapeways has a nice material selector for picking the materials you like and provides detailed information to use when you create your model. Metals are especially complex because they need to print a mold first. Once it is done, they have to pour the hot metal into the mold and then polish the result. Although fine details are possible, they might get lost during polishing and they might not reach all areas for polishing.

I have one model printed in Elasto plastic, which is fun stuff. This model can bounce since it’s a bit rubber-like. I have 4 models in hard plastic and two dinosaurs in sandstone, I’ve ordered a few more but they tend to be canceled because of small flaws that are discovered during manual checkups before they start printing. Often, it’s just the wall thickness, loose shells or other minor flaws but they are important because your finely detailed model might miss some fingers or other parts because these walls were too thin. Or the model is made from two or more parts and not all printers can print multiple parts.

Still, you can always tell Shapeways to print it anyways. I did so with several models and the results were fine. Except for one sandstone model, where the legs had broken off and some parts had shifted.

So, how do 3D printing and 3D rendering differ from one another? Well, there are a lot of differences and as I’ve discovered, when rendering I have some semi-transparent parts in my model that adds some special effects. For example, my model has a cornea that adds reflection or other special effects to the eye. But in a 3D print, there is no transparency so it becomes a blob over the colors of the iris.

Also, with rendering you tend to use bump mapping and set up special lighting to make the model look good. In printing, all you have is the shape of the model, nothing else. Details have to be part of the shape when printing while rendering images allows other tricks for those details.

And printing has only one color, unless you choose the 3D color printing options. You can still paint your model afterwards and to do so, I would recommend the strong, white plastic and acrylic paints. Of course, a color print is optional but the result might not be what you expect. Again, in a 3D rendering, the colors can be enhanced by using all kinds of techniques. For a 3D print, you’ll have to find a place in your house where the light will show your model from its best side.

Finally, the printing quality. If we were talking about 2D printer, we’d be talking at the number of DPI of a printer. In 3D world, we have to look at the volume of the smallest particle that the printer supports. And this also makes clear why 3D printing tends to be slow. If the smallest part is 0.2×0.2×0.2 millimeters and you’re printing something that fits a box of 20x20x30 centimeters then you’re using a lot of drops! Of course, the model will be smaller than such a box but my Bianca model was almost 80 cubic centimeters.

And to be honest, my 3D print needs a bit of polishing since those particles leave very, very tiny bumps on my model. Still, my sandstone dinosaur are made from bigger particles and feel like very fine sandpaper. Polishing should be possible, though. I just don’t want to risk it.

I’m still waiting for a few more models to return from the printer. I want my dinosaur in colored plastic just to see what that material is like. I also ordered it in white plastic for painting purposes. And I ordered two sandstone prints of this model:

Ruby on the Rocks model_0001

Two versions because I used two different hair styles.

I hope this will print well and to help the printing process, I made sure the model is on a plateau for stability and put the hands and feet against something solid. I’ve set the bikini top and bottom to the thickest setting and now I just have to wait until they can take it into production.

So, my conclusion is that 3D printing has its challenges. I still have to wait for my 3D printer to arrive before I can really start making my stuff but for now, Shapeways is providing me a great service for testing purposes. Okay, a lot of my models have been rejected for flaws but you can only learn from your flaws! So I’m fine with that. I just start all over again until it goes right.