Boolean Modifier - Difference (Subtract) Operation Broken #71524

Closed
opened 2019-11-12 19:13:13 +01:00 by Adam Janz · 12 comments

System Information
Operating system: Windows-8.1-6.3.9600 64 Bits
Graphics card: GeForce GTX 970/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 417.22

Blender Version
Broken: version: 2.81 (sub 16), branch: master, commit date: 2019-11-12 13:28, hash: 1252577580
Worked: (optional)

Short description of error
When using a boolean modifier on a plane mesh with the "Difference" operator, the operation will incorrectly show as if "Union" was selected, unless the cutout mesh is EITHER:

A. Flush on one edge with the plane; OR
B. Partially outside the plane.

Please see attached image and attached .blend file for a clear example.

Thank you so much.

Boolean Bug Blender 2.81.16.PNG

Exact steps for others to reproduce the error
.blend file attached

Boolean Error.blend

**System Information** Operating system: Windows-8.1-6.3.9600 64 Bits Graphics card: GeForce GTX 970/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 417.22 **Blender Version** Broken: version: 2.81 (sub 16), branch: master, commit date: 2019-11-12 13:28, hash: `1252577580` Worked: (optional) **Short description of error** When using a boolean modifier on a plane mesh with the "Difference" operator, the operation will incorrectly show as if "Union" was selected, unless the cutout mesh is EITHER: A. Flush on one edge with the plane; OR B. Partially outside the plane. Please see attached image and attached .blend file for a clear example. Thank you so much. ![Boolean Bug Blender 2.81.16.PNG](https://archive.blender.org/developer/F8051056/Boolean_Bug_Blender_2.81.16.PNG) **Exact steps for others to reproduce the error** .blend file attached [Boolean Error.blend](https://archive.blender.org/developer/F8051061/Boolean_Error.blend)
Author

Added subscriber: @AdamJanz

Added subscriber: @AdamJanz
Author

I can confirm this bug affects every version of 2.8, including the official release. I tested every build I had on hand all the way back to Blender 2.8 Hash: 388ff003e2 (v 2.80.48), and they all behave the same. The only version of Blender where this bug does not exist is 2.79.6.

I can confirm this bug affects every version of 2.8, including the official release. I tested every build I had on hand all the way back to Blender 2.8 Hash: 388ff003e28b (v 2.80.48), and they all behave the same. The only version of Blender where this bug does not exist is 2.79.6.
Author

Adding a solidify modifier at the top of the stack and un-checking "only rim" appears to cause the boolean operation to behave as normal. This could be a temporary workaround, but reveals that the Boolean Difference operation CANNOT presently work on objects without thickness (ie. a 2D plane).

Adding a solidify modifier at the top of the stack and un-checking "only rim" appears to cause the boolean operation to behave as normal. This could be a temporary workaround, but reveals that the Boolean Difference operation CANNOT presently work on objects without thickness (ie. a 2D plane).

Added subscriber: @Stan_Pancakes

Added subscriber: @Stan_Pancakes

Current Booleans indeed cannot reliably work on open geometry. We would have to wait for the new Boolean implementation, which is supposedly not that long.

Current Booleans indeed cannot reliably work on open geometry. We would have to wait for the new Boolean implementation, which is supposedly not that long.
Member

Added subscribers: @howardt, @lichtwerk

Added subscribers: @howardt, @lichtwerk
Member

Actually, I think the upper example you marked in red (not working), is the one I would judge "working" -- and the other ones failing...

Yes booleans are on the list of things to rewrite.
There is a long list of stuff that fails, see #47030 (BMesh booleans (track todo's))

Pretty sure this is a duplicate [will assume it is #61845, but it could be others of the list as well...]

I could add to the list an example where object transform will make it fail [apply rotation in the following file to see a difference]
untitled.blend

Lets hope for the work of @howardt to release us from the pain soonish :)

Actually, I think the upper example you marked in red (not working), is the one I would judge "working" -- and the other ones failing... Yes booleans are on the list of things to rewrite. There is a long list of stuff that fails, see #47030 (BMesh booleans (track todo's)) Pretty sure this is a duplicate [will assume it is #61845, but it could be others of the list as well...] I could add to the list an example where object transform will make it fail [apply rotation in the following file to see a difference] [untitled.blend](https://archive.blender.org/developer/F8060273/untitled.blend) Lets hope for the work of @howardt to release us from the pain soonish :)
Member

Closed as duplicate of #61845

Closed as duplicate of #61845
Author

Thanks Philipp. Well, since the difference operation is supposed to be "subtract" (ie. cutting a hole), the 1st example which "combines" the geometry together is incorrect, while the other two examples work as expected. But as mentioned, this error only occurs when the object being acted upon has no thickness. So yes, it is definitely a strange bug and I hope the super-smart Blender devs will discover the root cause of this... :-) And wow, I didn't even know about that bug when applying rotation. That makes absolutely no sense. You'll notice that it switches to the same incorrect "combine" mode after the geometry is applied, so no doubt the two bugs are somehow related...

Thanks Philipp. Well, since the difference operation is supposed to be "subtract" (ie. cutting a hole), the 1st example which "combines" the geometry together is incorrect, while the other two examples work as expected. But as mentioned, this error only occurs when the object being acted upon has no thickness. So yes, it is definitely a strange bug and I hope the super-smart Blender devs will discover the root cause of this... :-) And wow, I didn't even know about that bug when applying rotation. That makes absolutely no sense. You'll notice that it switches to the same incorrect "combine" mode after the geometry is applied, so no doubt the two bugs are somehow related...
Author

In #71524#810103, @Stan_Pancakes wrote:
Current Booleans indeed cannot reliably work on open geometry. We would have to wait for the new Boolean implementation, which is supposedly not that long.

Thanks Stanislav. I will look forward to that fix... :-)

> In #71524#810103, @Stan_Pancakes wrote: > Current Booleans indeed cannot reliably work on open geometry. We would have to wait for the new Boolean implementation, which is supposedly not that long. Thanks Stanislav. I will look forward to that fix... :-)
Member

Boolean operations are intended to be interpreted as if they are operating on 3d volumes. So, e.g., difference A-B (for objects A and B) means everything inside the volume of A, but excluding any point that is also in volume B. The currently implemented BMesh Boolean code assumes that the two objects are closed volumes -- that is, there are faces all around that are tightly sealed together and you can clearly figure out what is inside and what is outside the volume implied by those faces connected faces.

The example here doesn't have that property, so technically this is not a bug. The code tests inside vs outside by shooting a ray in an arbitrary direction and counting how many faces of the other object it encounters. This is guaranteed to work in the watertight-closed-faces situation I just described, but not otherwise. But it might accidentally work sometimes, which is why you are finding situations where it seems to work and others where it doesn't.

The old Carve solver handled some non-closed-face cases, though I don't know in detail for which cases it was guaranteed to work. I believe it worked when one object was a plane and the other object was a closed object, for instance.

The code I am writing right now (it is getting very close to working -- works on a number of cases already) is using another method to test inside vs outside: something called the "generalized winding number". This is more expensive to calculate (so I may have to make it optional, and use faster ray shooting if the user wants), but it allows non-closed objects to be roughly considered as having insides and outsides. I think it might handle the case in your example, but am not sure yet.

Boolean operations are intended to be interpreted as if they are operating on 3d volumes. So, e.g., difference A-B (for objects A and B) means everything inside the volume of A, but excluding any point that is also in volume B. The currently implemented BMesh Boolean code assumes that the two objects are closed volumes -- that is, there are faces all around that are tightly sealed together and you can clearly figure out what is inside and what is outside the volume implied by those faces connected faces. The example here doesn't have that property, so technically this is not a bug. The code tests inside vs outside by shooting a ray in an arbitrary direction and counting how many faces of the other object it encounters. This is guaranteed to work in the watertight-closed-faces situation I just described, but not otherwise. But it might accidentally work sometimes, which is why you are finding situations where it seems to work and others where it doesn't. The old Carve solver handled some non-closed-face cases, though I don't know in detail for which cases it was guaranteed to work. I believe it worked when one object was a plane and the other object was a closed object, for instance. The code I am writing right now (it is getting very close to working -- works on a number of cases already) is using another method to test inside vs outside: something called the "generalized winding number". This is more expensive to calculate (so I may have to make it optional, and use faster ray shooting if the user wants), but it allows non-closed objects to be roughly considered as having insides and outsides. I think it might handle the case in your example, but am not sure yet.
Author

@howardt Thanks so much, Howard, for that detailed explanation and clarification! I look forward to seeing the advanced solutions you are creating.

For me, I'd like to be able to achieve a cut like #1 (top) in my example BUT one that behaves like #3 (bottom) (ie. have a Boolean modifier cut a hole in a 2D plane, but then ALSO be able to Solidify that plane ONLY along its rim and the rim of any cut holes using the Solidify modifier [at the bottom of the modifier stack with "Fill Rim" and "Only Rim" selected]. This way the plane is only "thick" at the cut and does not have backfaces anywhere else, thus saving on wasted geometry for later import into a game engine).

Thank you again for all your hard work!

  • Adam
@howardt Thanks so much, Howard, for that detailed explanation and clarification! I look forward to seeing the advanced solutions you are creating. For me, I'd like to be able to achieve a cut like #1 (top) in my example BUT one that behaves like #3 (bottom) (ie. have a Boolean modifier cut a hole in a 2D plane, but then ALSO be able to Solidify that plane ONLY along its rim and the rim of any cut holes using the Solidify modifier [at the bottom of the modifier stack with "Fill Rim" and "Only Rim" selected]. This way the plane is only "thick" at the cut and does not have backfaces anywhere else, thus saving on wasted geometry for later import into a game engine). Thank you again for all your hard work! - Adam
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#71524
No description provided.