4
$\begingroup$

I love using Blender for modeling things, however, the boolean modifier is not always the most reliable. The fact that it can't bool 2 faces that are right against each other and can't handle 2 vertices overlapping is a big problem if you are trying to do 3d printing.

Example, If I Try to boolean 2 cubes with intersecting faces it looks good on the surface. 2 cubes booled

But if you apply the modifier and look at the mesh it is very disjointed and non-manifold. enter image description here This makes a lot of cleanup work that you don't come across in even relatively basic cad programs like tinkercad.

Why from a technical standpoint can't blender handle these situations as well as something like freecad?

$\endgroup$
5
  • $\begingroup$ I was just able to bool two cubes together sharing one vert using the fast solver, but not when using exact. Maybe a bug, or it would be hilarious if the labels were wrong. $\endgroup$ Commented Mar 17, 2021 at 0:10
  • 6
    $\begingroup$ The short answer is that Blender is not a CAD program and isn’t trying to be, and it therefore optimizes for different things. CAD programs generally use a different internal representation of geometry, known as boundary representation, which is explicitly designed to support constructive solid geometry operations such as booleans. That works well for CAD but is not efficient for 3D graphics, so Blender is primarily built around meshes. If you want CAD, use a CAD program. $\endgroup$ Commented Mar 17, 2021 at 0:14
  • 3
    $\begingroup$ On a more meta note, I think my previous comment is a perfectly adequate, non-opinion-based answer to this question, so I don’t really think it needed to have been closed. If it is reopened I would be happy to elaborate my comment into a full answer. $\endgroup$ Commented Mar 17, 2021 at 0:16
  • $\begingroup$ I don't quite understand how boundary representation and mesh representation are different. both give the shapes an inside and an outside, and both use mathematical points in space to determine the shapes right? I added some more detail and made its wording more objective hopefully the question will be reopened I will be able to credit an answer to you.@AlexisKing $\endgroup$
    – Michael
    Commented Mar 17, 2021 at 0:33
  • $\begingroup$ I agree with all of this $\endgroup$ Commented Mar 17, 2021 at 0:34

1 Answer 1

9
$\begingroup$

The short answer is that Blender is not a CAD program, it is a 3D modeling program, and the two domains have very different goals and constraints.

Boundary representation

CAD programs are designed to create specifications of physical objects. They must be physically accurate, because when a CAD-designed part is actually manufactured, there is no room for cheating. Parts must be machined to high tolerances with exact dimensions and geometry; there is not much room for error when fitting screw threads to a hole. This means CAD tools choose internal representations of geometry that express the shape as directly and accurately as possible.

Specifically, most CAD programs use what’s called boundary representation (B-rep). Boundary representation is a generalization of constructive solid geometry (CSG), which is fundamentally a compositional description of how to obtain a solid volume from operations on simpler primitives. One of the essential concepts behind B-rep is that it is symbolic; a perfectly smooth curve can be described using a mathematical description of a spline, which can be differentiated at arbitrary points.

Mesh representation

In contrast to this, Blender uses a mesh representation of geometry, which is far more discrete. A mesh cannot represent a spline exactly, because a mesh must be composed of some finite number of straight edges. Therefore, a mesh can only approximate a spline using some discretization scheme that provides sufficient resolution from a certain viewing distance.

To compensate for this, computer graphics uses lots of tricks (or “cheats”) to hide discretization errors. One of the most obvious ones is “smooth shading,” which interpolates normals across faces. Smooth shading is a meaningless concept in the context of CAD, because when a part is physically realized, all that matters is the geometry. Faking normals only makes sense when one is generating a 2D projection of a scene, as occurs in 3D rendering.

Of course, the obvious advantage of this approach is speed: the discrete mesh representation is much closer to what graphics hardware can actually usefully consume, so when rendering B-rep on a computer screen, it must first be discretized into a mesh anyway. An advantage of B-rep is that the discretization is performed internally, on the fly, by the CAD program, so it can be performed adaptively at any viewing resolution. No information is ever lost, since the user edits the abstract, symbolic description of the shape they are trying to model, which serves as an “infinite resolution” source of truth for the discretization process.

Boolean operators

What does any of this have to do with Boolean operators? After all, a mesh does still mathematically define a boundary, just one made entirely from straight edges. And that’s true, but there’s an important difference!

Since B-rep is a symbolic representation, Boolean operations are similarly represented internally using a symbolic, mathematical description. Because each operand to the Boolean is an “infinite-resolution” mathematical description of a volume, the result of the Boolean can also be interpreted mathematically with “infinite precision.” Just as discretization of a spline can be adaptively performed at any resolution, discretization of the result of the Boolean can be similarly reevaluated using any technique at any resolution necessary, again with no loss of information.

With a mesh, Boolean operations are destructive, and their operands have already been discretized. You cannot union a sphere with a cube, you can only union an approximation of a sphere with a cube, and what you get back will necessarily be a new, modified mesh. Of course, if you leave the modifier unapplied, the operation will be dynamically recomputed as each mesh changes, similar to the behavior in a CAD program, but once you apply it, the mathematical structure is permanently committed to the mesh.

In a CAD program, there is no way to “apply a Boolean operator” in the sense that you can in Blender. The representation is fundamentally always a non-destructive, mathematical specification of the volume, and the discretization is performed behind the scenes, in real time. This of course means you do not get any direct control over the discretization, but that’s okay for CAD, because you care more about what will happen when the model is interpreted by CNC or a 3D printer, not a graphics card. Even if the same kind of non-manifold mesh you get in Blender is internally generated by your CAD program, you can never directly see or interact with the mesh, so the illusion is never broken. When you modify the parameters of your CAD specification, the Boolean is simply reevaluated on the fly to get a new mesh.

In other words, Blender is using a representation that is fundamentally lower-level than B-rep is. This gives you far more control, and it can be far more performant, but it also means you have to suffer the consequences of destructive modeling and manually manage discretization. In a CAD program, you never care about “bad topology” generated by Boolean operations because “mesh topology” is an implementation detail needed only for visualization, and it doesn’t have to be efficient. In 3D modeling, you do care, and you therefore have to deal with the consequences.

$\endgroup$
2
  • $\begingroup$ Very good read. Thanks :). $\endgroup$ Commented Mar 20, 2021 at 7:47
  • $\begingroup$ A good read indeed! $\endgroup$ Commented Mar 20 at 14:57

You must log in to answer this question.

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