logo elektroda
logo elektroda
X
logo elektroda

Blender/Boolean - How to fit two STL print elements together

p.kaczmarek2 2799 3

TL;DR

  • Fits two mismatched STL 3D print parts in Blender, using a decorative house canopy and base as the example.
  • Uses the Boolean modifier, especially Boolean Difference, on imported STL meshes to automatically reshape one part, then accepts the modifier and fine-tunes the mesh.
  • The processed object reached almost half a million triangles, and Blender still handled the Boolean operation.
  • The corrected parts fit together flawlessly after printing, with a snug press-fit that needs no glue.
  • Boolean failures usually come from non-watertight meshes, inconsistent normals, duplicate vertices, or dense geometry, so backface culling and mesh cleanup help.
Generated by the language model.
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
📢 Listen (AI):
  • Blender/Boolean - How to fit two STL print elements together
    Hello my dears.
    Here I will demonstrate a simple way to match any two 3D objects, for example imported from STL format. The matching will be done automatically and will allow us to print elements that can be glued and/or clamped together. I will perform the matching in Blender based on the boolean modifier, in this case using the boolean difference of the shapes.

    Where did the idea for the topic come from?
    The idea to write this topic came when I myself came across the problem of fitting two pieces together. I was printing a decorative house for someone from PLA filament, which consists separately of a canopy and a base:
    Blender/Boolean - How to fit two STL print elements together
    This is the finished model, so everything should fit together, right?
    Blender/Boolean - How to fit two STL print elements together
    Blender/Boolean - How to fit two STL print elements together
    Unfortunately, after downloading the STLs and printing them without changing the scale, it became apparent that the reality was more problematic:
    Blender/Boolean - How to fit two STL print elements together Blender/Boolean - How to fit two STL print elements together
    (in the photo the print is not yet fully cleaned of support and raft, but that is not the purpose of this topic)
    I know the pictures don't do it justice, but the pieces don't match up in any way. And it's not a matter of precision of printing, or there pressing them together, the margin of error is too big, it just looks like the author of the model forgot to give the last version of one of the elements....
    It's time to fix this.

    Correcting STLs in Blender
    Blender can import and export STLs without any problems. The STL is essentially just a collection of vertices and polygons (created from just those vertices) and nothing more.
    Objects from e.g. Thingiverse are also in this format.
    I imported both models to see if they really don't match:
    Blender/Boolean - How to fit two STL print elements together
    Clearly they don't:
    Blender/Boolean - How to fit two STL print elements together
    This could be manually corrected by fully modifying the grid, but automatic solutions are better.
    Just use the boolean modifier. In Blender it works on even arbitrary shapes, even with a lot of triangles:
    Blender/Boolean - How to fit two STL print elements together
    In the newer Blender it looks like this:
    Blender/Boolean - How to fit two STL print elements together
    Boolean performs a boolean operation on two shapes. It adds, subtracts or combines the current object with the given selected object.
    Blender/Boolean - How to fit two STL print elements together
    The result (after Blender has been running for a while):
    Blender/Boolean - How to fit two STL print elements together
    Blender/Boolean - How to fit two STL print elements together
    (for comparison, without boolean):
    Blender/Boolean - How to fit two STL print elements together
    Then you can possibly accept the boolean (replace the modifier so that its changes are saved permanently in the mesh, then the modifier itself disappears from the list):
    Blender/Boolean - How to fit two STL print elements together
    And possibly still do manual adjustments (manually select two walls and then Select Linked Faces option and done).
    Blender/Boolean - How to fit two STL print elements together
    and still e.g. scale down (reduce) the selection.
    By the way, the processed object has almost half a million triangles and Boolean still embraces it.
    Blender/Boolean - How to fit two STL print elements together


    Final fitting
    After my correction, everything fits together flawlessly. It fits snugly, you don't even need to glue altogether. Revelation, it is a pity that the original STLe is not well prepared....
    Blender/Boolean - How to fit two STL print elements together Blender/Boolean - How to fit two STL print elements together

    Demonstration of three boolean modes
    I think it is still worth showing on simple shapes what the three boolean modes are.
    NOTE: in the examples I have only used a cube (cube) and a sphere (sphere), these are convex solids, but in Blender boolean works on other shapes too, they don't have to be convex!
    Two objects:
    Blender/Boolean - How to fit two STL print elements together
    Their sum:
    Blender/Boolean - How to fit two STL print elements together
    Common part:
    Blender/Boolean - How to fit two STL print elements together
    Difference (cube subtracted from sphere):
    Blender/Boolean - How to fit two STL print elements together
    I think this is a good illustration of how Booleans work in Blender (and beyond).


    Troubleshooting
    However, Boolean may not always work as expected, even though it can handle a really wide variety of shapes in the current version. Below I give a few tips that will solve most problems with boolean.
    1. is the object airtight, 'watertight', or does it have holes in the mesh? The holes should be closed, this can also be messed up by Slicer e.g. Cura:
    Blender/Boolean - How to fit two STL print elements together
    2. are the wall normal vectors consistent, are there no inverted walls? In Blender, it's a good idea to select the whole thing and do a "make normals consistent".
    But inverted walls are also visually visible in Blender (different shade):
    Blender/Boolean - How to fit two STL print elements together
    NOTE: if, on the other hand, we have 'backface culling' turned on, the back side of the wall will not be visible at all, the wall will only be visible on one side and on the other side we will just see a lack in the geometry.
    3. in case of problems you can remove duplicate vertices (Remove Doubles)
    4. it is worth trying both boolean implementations (BMesh and Carve) and changing the overlap threshold:
    Blender/Boolean - How to fit two STL print elements together
    5. in the case of complex or leaky geometry, the boolean can 'reverse' the operation of its modes, e.g. make a difference instead of an intersection, etc. It's worth simply selecting a different boolean mode on a trial basis and seeing what results it gives (although this is treating the effects rather than the causes, better to improve the mesh)
    6. If the mesh is very dense (has a lot of triangles) then it can be reduced (modifier decimate).
    7. if the result of a boolean operation after export to Cura or any other slicer you use, generates a strange print after giving "Preview" (print preview), it means that probably the source shapes were not tight, i.e. they had holes in the mesh and the generated object also has holes in the mesh, which spoils the slicer.
    8. in order to better see the state of the object mesh, I recommend turning on "backface culling" in Blender (then the 'back' sides of the walls, e.g. those from the centre of the cube, will not be visible)

    Summary
    Blender allows you to very easily modify and enhance any STL models, for example ones downloaded from Thingiverse. In addition, in Blender you can do boolean operations on imported models and the boolean modifier supports even complex shapes, as well as dealing with large numbers of triangles. This makes it possible to quickly fit two objects together, so that, for example, they fit press-fit after printing.
    In the case described in this topic, I basically just applied the boolean once and then scaled down a section of the model and everything fit together perfectly the first time. These are just two operations that can be learned in a few minutes and as you can see actually even saved the print and the model.

    Cool? Ranking DIY
    Helpful post? Buy me a coffee.
    About Author
    p.kaczmarek2
    Moderator Smart Home
    Offline 
    p.kaczmarek2 wrote 14407 posts with rating 12345, helped 650 times. Been with us since 2014 year.
  • ADVERTISEMENT
  • #2 19617683
    andrzejlisek
    Level 31  
    Posts: 3635
    Help: 82
    Rate: 705
    Also, does Blender have a function to automatically refill holes in the mesh if the object, as you write, is not tight?
  • ADVERTISEMENT
  • #3 19617926
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14407
    Help: 650
    Rate: 12345
    There is 'Fill Holes', you have to check for yourself depending on the version what shortcut there is for this, I enable it by pressing the spacebar and typing the name of the operation (a reliable way if you don't remember the shortcut).
    For the demonstration of Fill Holes I will remove these walls:
    Blender/Boolean - How to fit two STL print elements together
    So that these holes remain:
    Blender/Boolean - How to fit two STL print elements together
    Operation:
    Blender/Boolean - How to fit two STL print elements together
    Corrections generated:
    Blender/Boolean - How to fit two STL print elements together
    You could still make them Triangulate to turn polygons into triangles, but it's not so bad....
    although if you want a really good mesh I would still recommend checking manually.
    After triangulation:
    Blender/Boolean - How to fit two STL print elements together

    The mesh in general should be airtight, watertight, i.e. that if you imagine pouring water inside it, the water "has no way to pour out".

    PS: in general this canopy house object based on which I demonstrated the boolean (and now fill holes) has too dense a mesh for 3D printing, you don't need so many triangles until, it unnecessarily slows down the slicer and the rest of the operations in Blender, everything works slowly. You could do automatically reduce the number of triangles (decimate) and it would look the same. But I didn't reduce this number of triangles before because I wanted to see if the boolean could do it, and as you can see it did without problems.
    Helpful post? Buy me a coffee.
  • #4 19622926
    VIGOR_PICTURES
    Level 21  
    Posts: 869
    Help: 20
    Rate: 146
    Regarding the automatic filling of holes in the mesh: After the installation of the add-on related to 3D printing, in the "3D Print" toolbox (accessible from the toolbar - n key on the keyboard) there is a button called "Make manifold". This works sometimes better sometimes worse. In any case, nothing can replace a "human" who knows what he is doing and manually manifolds the hole.
    And to the author, as usual a very decent tutorial related to Blender and 3D printing.
    Have you thought about starting to record your efforts? For beginners it might be an extra help to watch the video.
📢 Listen (AI):

FAQ

TL;DR: Use Blender’s Boolean Difference to auto‑match misfitting STL parts; it handled ≈500k triangles for the author. “After my correction, everything fits together flawlessly.” [Elektroda, p.kaczmarek2, post #19617445]

Quick Facts

How do I fit two STL print elements together in Blender?

Import both STLs. Select the part that must receive the other. Add a Boolean modifier, choose Difference, and set the other part as the target. Apply the modifier, then make minor scale adjustments if needed for a press‑fit. Test in your slicer. [Elektroda, p.kaczmarek2, post #19617445]

Which Boolean mode should I use to make one part host the other?

Use Difference on the receiving part. It subtracts the shape of the inserted part, creating a matching cavity or interface. Union adds volumes, while Intersect keeps only the overlap. Difference is the standard choice for fitting printed assemblies. [Elektroda, p.kaczmarek2, post #19617445]

How do I apply the Boolean result permanently to the mesh?

After confirming the preview looks right, click Apply in the Boolean modifier. This bakes the result into the mesh and removes the modifier entry, making the change permanent. Save a copy before applying if you want a non‑destructive backup. [Elektroda, p.kaczmarek2, post #19617445]

What if the Boolean operation fails or gives strange results?

Check mesh health first. Ensure the model is watertight, fix inverted normals, and remove duplicate vertices. Try the other Boolean solver and adjust overlap threshold. On leaky or complex meshes, modes can appear inverted; repair geometry, then retry. [Elektroda, p.kaczmarek2, post #19617445]

How can I check and fix inverted normals quickly?

Enable backface culling to visualize inside‑out faces. Select the mesh and run Make Normals Consistent to unify directions. Recheck shading and redo the Boolean. Consistent normals help both viewport previews and slicer outputs. [Elektroda, p.kaczmarek2, post #19617445]

Is there an automatic way to refill holes in a mesh?

Yes. Use Fill Holes. Invoke it via the search menu if you forget the shortcut. Review the patch, and optionally Triangulate to stabilize the topology. Quote: “The mesh … should be airtight, watertight.” [Elektroda, p.kaczmarek2, post #19617926]

Does Blender offer a one‑click "make manifold" tool for 3D printing?

Install the 3D Print add‑on and use the Make Manifold button in the N‑panel. It can work, but results vary. Always inspect and correct manually where needed, as a skilled pass produces the most reliable prints. [Elektroda, VIGOR_PICTURES, post #19622926]

My Boolean result looks fine in Blender but slices wrong—why?

Your source shapes likely weren’t watertight, so the exported result still has holes. Repair the meshes, reapply the Boolean, and re‑export. Validate in your slicer’s Preview to confirm proper paths before printing. [Elektroda, p.kaczmarek2, post #19617445]

Will Blender handle very dense triangle meshes for this workflow?

Yes. The author demonstrated a model with almost 500,000 triangles and Boolean still completed successfully. If editing becomes slow, Decimate to reduce triangle count without visible loss for prints. [Elektroda, p.kaczmarek2, post #19617445]

Should I reduce triangle count before or after Boolean?

If performance is sluggish, Decimate before heavy edits. Otherwise, keep original detail for maximum fidelity, then Decimate after fitting. Always watch for topology artifacts and keep a copy of the high‑detail source. [Elektroda, p.kaczmarek2, post #19617926]

What are the three Boolean modes and when do I use them?

Union combines volumes for merged prints. Intersect keeps only overlapping regions for joints. Difference subtracts one mesh from another to create cavities or keyed interfaces. For fitting two parts, start with Difference. [Elektroda, p.kaczmarek2, post #19617445]

Can Boolean ever produce the "wrong" mode outcome?

Yes. With complex or leaky geometry, the solver may appear to invert results, like acting as Intersection instead of Difference. Fix mesh issues first, then retest the modifier. [Elektroda, p.kaczmarek2, post #19617445]

Quick 3‑step: how do I get a press‑fit from mismatched STLs?

  1. Add Boolean Difference on the receiving part, target the other part.
  2. Apply the modifier; inspect for watertightness and normals.
  3. Slightly scale the mating region for friction fit; export and slice. [Elektroda, p.kaczmarek2, post #19617445]

Do I need glue after fixing with Boolean?

Not always. The example fit snugly without glue after Boolean and a small scale adjustment. Test your tolerances on a small section before a full print to save time and material. [Elektroda, p.kaczmarek2, post #19617445]
Generated by the language model.
ADVERTISEMENT