Merge STL files with openscad

Last week, I wanted to create a holder for our shoehorn. By that time it seemed appropriate that great Cthulhu himself will do us the honor in form of a statue.

I needed to manipulate the STL-file to add the actual holding parts and some mounting blocks for magnets that will hold the thing in place. My tool of choice was Freecad, and I was able to add the necessary parts to the model.

However … When I wanted to create a single shape out of the statue and the modifications I simply mistook merge for union; but in the world of points and shapes, this is not the same as a union. (The difference is that a merge will simply put all point/areas into one file, a union will think more about which part is visible and which is not). Fun fact: As I am using Cura as my primary slicer, I didn’t notice this mistake. It seems as Cura will fill everything inside the boundaries and assumes that this is the right way to do. When you are using Simplify3D, this is an issue.

Long story short: The Simplify3D sliced statue came out of the printer, looked great and the modification fell off immediately. I could fix the whole thing with a hot-glue gun, but the result was devastating.

To repair this issue I had to use OpenSCAD to do the union. Hence, the statue and the holding parts were treated as two separate parts in form STL files and united with the following snippet:

module move() {
  translate([0,-22,0]){
      import_stl("Cthulhulow.stl");
  };
}

union(){
    import_stl("addtocuth.stl");
    move();
};

The translation function was necessary to have both parts perfectly aligned, since I didn’t take too much care while exporting the whole thing. I am very pleased with the result: cthulhu

Found an error or you have something to comment? Drop me a line!