12
$\begingroup$

This is a follow-on question as suggested by a commenter. What I'd like to do is to create a geometry with the following properties:

A cube with several spherical indentations carved out on top. 16 indentations are half-spheres. The 17th indentation has the shape of four half-cylinders that form a ring (with slightly rounded corners corresponding to the radius of the cylinders).

My plan of attack is as follows:

  1. create and scale the cube
  2. create 16 spheres clustered around the center of the cube's top face
  3. create 4 cylinders, scale and rotate them to form the basic ring
  4. create 4 more spheres at the corners to complete the ring
  5. add 16 DIFFERENCE boolean modifiers to the cube with the 16 spheres from step 2 as targets; hide each sphere after adding the corresponding modifier
  6. add 4 DIFFERENCE boolean modifiers to the cube with the 4 cylinders from step 3 as targets; hide each cylinder after adding the corresponding modifier
  7. add 4 DIFFERENCE boolean modifiers to the cube with the 4 spheres from step 4 as targets; hide each sphere after adding the corresponding modifier

Steps 1 + 2 work as expected:

enter image description here

Steps 3 + 4 also work as expected:

enter image description here

And so does step 5:

enter image description here

And even step 6 for the 1st cylinder:

enter image description here

However when I try to subtract the 2nd cylinder the visual result is unexpected and the error message appears:

enter image description here

enter image description here

What is going on here and how can I obtain the desired geometry?

Could the problem be caused by the fact that the two cylinders I wish to subtract from the cube are themselves overlapping? (The Blender documentation mentions "concurrent Boolean operations for the same modified mesh, which in most cases is impossible to execute depending on the chosen target" but does not elaborate further.)

UPDATE Here's the (still expected) result when joining the 4 cylinders and last 4 spheres before subtracting the from the cube (see @Polosson's comment):

enter image description here

$\endgroup$
12
  • 1
    $\begingroup$ I suggest you upload the typical .blend file via pasteall.org/blend, and paste the link here, which can be helpful for others to make quick help, too. $\endgroup$ Nov 27, 2013 at 11:19
  • 1
    $\begingroup$ What happen if you make all spheres ONE object (press <kbd>CTRL</kbd> <kbd>J</kbd>), and all cylinders another, then use only 2 boolean modifiers ? $\endgroup$
    – Polosson
    Nov 27, 2013 at 12:05
  • 2
    $\begingroup$ @Drux, I've pointed it out, actually -- for quicker help in answer your quesion.:) Alright, I've followed your steps, it indeed happened, I have to admit that. If you want to make a final result, I suggest you take Polosson's way. But it seems that you want to know what or why on earch caused such issue. Me too. $\endgroup$ Nov 27, 2013 at 12:35
  • 1
    $\begingroup$ Btw, according to my experience on multiple Boolean modifiers, the combined result sometimes depends much on the their orders in the Modifier stack. So, you may try to move up the cylinder boolean(s) up above one or more sphere booleans, and see whether it would make any difference to the final result. $\endgroup$ Nov 27, 2013 at 12:39
  • 2
    $\begingroup$ @Drux Continued.. It is of course your choice, I just wanted to point out some reasons why you may want to. Here are some meta posts: policy for linking to blendfiles and sites to upload images and blendfiles $\endgroup$
    – gandalf3
    Nov 28, 2013 at 1:06

3 Answers 3

14
$\begingroup$

Cases where boolean operations can fail:

  • Overlapping geometry between objects:
    Multiple vertices in the same location will often cause the boolean modifier to act up. From this bug report:

    this is a known bug in Carve upstream (a library we're using for boolean operations)

  • Self intersecting objects:
    Boolean operations with non-manifold objects or objects that are not water-tight will fail when non-manifold parts interact in the boolean operation.

Some things you can try:

Add supporting geometry. The boolean operation creates a lot of tris, so this might make subsequent operations difficult.

For example:

The spheres boolean causes this mess of tris where the cylinders will go:

enter image description here

However, if you add some loop cuts around the spheres:

enter image description here

The tris are contained in the center, keeping the topology clean where the cylinders intersect:

enter image description here

With modeling tools

You can get the result with conventional modeling too:

  1. Add a sphere and two cylinders (the cylinders are just guides)

  2. Rotate and move then into position using increment snapping (Ctrl) to keep everything precisely aligned:

    enter image description here

  3. Snap the 3D cursor to the sphere object by selecting (in object mode) it and pressing ShiftS> Cursor to Selected

  4. Press . (period) to set the pivot to the 3D cursor

  5. Enter edit mode with the sphere active and delete these elements with X or Delete> Vertices:

    enter image description here

  6. Scale the 45 degree edgeloop along the X and Y by pressing S and then ShiftZ, then holding Ctrl to snap until the edgeloop at 45 degrees touches the intersection at the two cylinders:

    enter image description here

    The cylinders are no longer useful after this step, so you can delete them.

  7. Select the vertices as shown:

    enter image description here

  8. Extrude along the X axis (EX):

    enter image description here

  9. Set the pivot to Bounding box center (,) and scale the selection to 0 along the X by pressing SXO (zero):

    enter image description here

  10. Do the same for the other side:

    enter image description here

  11. Add a mirror modifier and enable X and Y:

    enter image description here

  12. With the sphere active, enter edit mode and select all (A), then move it so the object origin is not in the middle of the sphere:

    1. Before:

      enter image description here

    2. After:

      enter image description here

  13. Enable Clipping in the mirror modifier and move each edge so it merges with the mirrored geometry:

    enter image description here

You can then use this for the boolean operations:

enter image description here

Here is the blendfile.

$\endgroup$
21
  • $\begingroup$ +1 also for loop cuts. Hmm ... when I try that I still get the same error when forming the union. I must be doing something wrong here. I've now uploaded the blend file on PasteAll (as @LeonCheung has suggested), the URL is pasteall.org/blend/25436 $\endgroup$
    – Drux
    Nov 28, 2013 at 3:39
  • $\begingroup$ @Drux It appears that it is because the cylinders object has self intersections (each cylinder in the object is intersecting the cylinder next to it). I haven't found a workaround yet.. $\endgroup$
    – gandalf3
    Nov 28, 2013 at 6:52
  • $\begingroup$ Yes, that has become my impression too, and it would be somewhat consistent with what the documentation says (as cited above). But how did it not happen in your solution? (Could you perhaps also post the blender file?) BTW, whether one uses UV or ISO spheres does not seem to make a difference either. $\endgroup$
    – Drux
    Nov 28, 2013 at 7:14
  • 1
    $\begingroup$ @Drux I also noticed the boolean operation seems to fail when verts overlap. Reported a bug here. BTW the previous bug is now fixed in git, as soon as I get my hands on an up to date version I'll test my idea. $\endgroup$
    – gandalf3
    Nov 29, 2013 at 4:31
  • 1
    $\begingroup$ @Drux The cylinders aren't used, and the scaling is so that the extruded bit is circular. The radius should be the same (Check the blendfile). Updated answer. $\endgroup$
    – gandalf3
    Nov 30, 2013 at 9:32
0
$\begingroup$

(work around, and probably obvious) - often if you perform the same modifications in a different order that results in the same final object you can avoid the dreaded "cannot boolean"

$\endgroup$
0
$\begingroup$

Well, purists say that we have to model everything, but boolean operations are far easier. Simple suggestion: export the mesh into .stl. Open with meshmixer (free app from autodesk). 1 - try edit - separate shells. Delete all shells that are not visible. 2 - export to stl. It should work now in blender.

if there are no separate shells: use edit - make solid. Try using accurate or sharp edges and move the triangle and face counts to the middle. look at the shape to see if the details are all there and re-export to stl. It shall work now with boolean operations in blender.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .