Combining multiple STL files

  • I have a collection of STL files, each containing a separate moving part of an object I want to print. (Imagine a set of gears, or similar, that prints as a single object with multiple moving parts.)

    My plan was to import them all into Cura, then hit print, then take my fully assembled object off the build plate. However, Cura ignores the coordinate system in the STL files and automatically separates the components from each other on the build plate. This is usually helpful, but it isn't what I want in this case.

    So I'm looking for a quick and simple way to combine my multiple STL files into a single STL file. I know that the objects don't overlap, so I don't need to do a CSG union operation - it's enough just to concatenate the objects.

    I tried OpenSCAD, which works, but it takes a really long time, because the meshes are fairly complex and it does the full Boolean operation. Is there another quick and simple way to perform this task?

    I'd prefer a command line utility, but I'd also be happy if there's a quick and simple way to do it in some free graphical software. (However, I don't want to spend time manually positioning the objects - they're already in the right places in the STL files, so I just want to import them and go.)

    Edit I've accepted Trish's answer (use Blender), but I'd still appreciate a command-line option if anyone knows one.

    How would you expect the 3D printer to print the parts movable and at their position at the same time? If they are not placed on the build platform there will be a lot of support needed.

    @KlausD. they are all in contact with the build platform and none of them have overhangs that would need support. However, they nevertheless interlock with each other in 3D space in such a way that they can't be separated.

    (If that sounds impossible, imagine that one object is an hourglass and the other is a torus that surrounds it, with only a small gap between the inner surface of the torus and the neck of the egg timer. Both contact the build plate and no overhang is more than 45 degrees, but the hourglass can't be removed from the torus.)

    @Pᴀᴜʟsᴛᴇʀ2 exactly that. But with the important provision that I know the parts don't overlap, so a Boolean union operation isn't needed.

    It is funny you ask about this ... Koenigsegg has to 3d print the turbochargers for his ultra-supercars called "One:1". Can it be done, yes. I'd bet it lends back to how it's designed more so than how the print is setup after design.

    @Pᴀᴜʟsᴛᴇʀ2 it's abut how the file is stored.

    It's trivial to position separate objects in MeshMixer and export the result as a single STL. I think you're trying to force a square solution into a round hole

    @CarlWitthoft the objects are positioned already, just in separate files, and the idea is to *not* need to reposition them. No square pegs here, just a beautiful round one produced by homegrown C++ code, which needs a little polishing before it will fit.

    (Well, to the extent that using a C++ library with overly restrictive I/O possibilities is a square solution, I agree that's the case here. Please take that up with the authors of CGAL, not me. It may be a square solution in that respect, but it's the only viable one in my case.)

  • Trish

    Trish Correct answer

    3 years ago

    What you try to do is called "Print in Place". However, it is not done by importing several STLs one after another as cura does remove the origin and recenters each imported object upon importing. However, an STL file can contain more than one body.

    To generate a PiP model, you need to export your whole project as one STL file containing all the parts and then Cura not only doesn't rip the model apart, it can't do so.


    If you can't export the whole project in one piece from your design software, you could use a workaround by importing it into a software that can export as one item. Among these is blender, so importing all the parts into blender and then exporting the whole project as one STL is a simple fix. Other options would be TinkerCAD or Fusion360.

    The Step by step guide for blender is simple and the general idea of this workflow is the same for other options:

    1. Open blender

    2. New project

    3. delete the cube via entf + enter

    4. Get the files into the workspace via either:

      • Drag & Drop

        1. File > Import > Stl (.stl)

        2. select the file + enter

    5. Possibly reposition the object, till it is in the right position

    6. Repeat 4. to 6. till all parts are imported

    7. File > Export > Stl (.stl) + enter

    My issue is that the program I'm using to create the objects is not able to export them as a single file, but only as separate ones. They do indeed need to be in one single STL file, but the question is about how to do that, given that the program will always output them in separate files.

    Which program? Fusion360 can export a whole project.

    I wrote the program myself. The C++ library I used does not have the functionality to put more than one object in an STL file.

    @Nathaniel then you might want to combine via blender by just importing all before exporting.

    Thanks for the edit. (+1) I'm not a blender user, and it is quite a complicated program - if you have time, step-by-step instructions would be super helpful.

    @Nathaniel the step by step is simple and added.

    another option is to import them into Tinkercad, position them, export all in one group. Tinkercad is free and substantially less complex than the magic of Blender

    @Trish cool, that worked, thank you. (I didn't need to reposition them, as you said, it respected their positions in the original files.) The only disadvantage is, Blender for some reason uses its own special file dialog, which uses different conventions from my OS and is therefore mildly painful to use. However, I found I could drag to select multiple files, and thus avoid importing them one by one. I'll accept this in a day or two.

    @Nathaniel Just came back to this question as I was looking for this workflow to link to, thanks for choosing your preferred workflow!

License under CC-BY-SA with attribution

Content dated before 7/24/2021 11:53 AM