Exact Boolean with Incorrect Result - multiprecision/float round trips not exact #82903

Open
opened 2020-11-21 15:59:09 +01:00 by Philip Holzmann · 5 comments

System Information
Operating system: Windows 64 bit
Graphics card: Nvidia GTX 750 Ti

Blender Version
Broken: 2.91.0 Beta dca36a8ec9

Short description of error
Another case, where the exact boolean does not work as expected. (Sorry @howardt, I had to break it. I have to admit, that I have not run into this problem in a real scene.)
Again, this manifests after applying the same difference operation several times.

Exact steps for others to reproduce the error
boolean_rotated_box3.blend
Look at the scene.
The first run of the modifier works as expected, the second creates overlapping faces, the third removes most of the mesh.
This "bug" is very erratic, and if the transform of the objects is slightly changed, it does not occur.

This is what I see:
boolean_rotated_box3.png

The expected behavior is that the second and third modifier do nothing.

**System Information** Operating system: Windows 64 bit Graphics card: Nvidia GTX 750 Ti **Blender Version** Broken: 2.91.0 Beta dca36a8ec922 **Short description of error** Another case, where the exact boolean does not work as expected. (Sorry @howardt, I had to break it. I have to admit, that I have not run into this problem in a real scene.) Again, this manifests after applying the same difference operation several times. **Exact steps for others to reproduce the error** [boolean_rotated_box3.blend](https://archive.blender.org/developer/F9348291/boolean_rotated_box3.blend) Look at the scene. The first run of the modifier works as expected, the second creates overlapping faces, the third removes most of the mesh. This "bug" is very erratic, and if the transform of the objects is slightly changed, it does not occur. This is what I see: ![boolean_rotated_box3.png](https://archive.blender.org/developer/F9348287/boolean_rotated_box3.png) The expected behavior is that the second and third modifier do nothing.

Added subscribers: @howardt, @Foaly

Added subscribers: @howardt, @Foaly

Added subscriber: @mano-wii

Added subscriber: @mano-wii

I can confirm but I'm not sure if this is a limitation with float precision.
So I will wait for a second opinion.

I can confirm but I'm not sure if this is a limitation with float precision. So I will wait for a second opinion.
Howard Trickey self-assigned this 2020-11-24 01:53:39 +01:00
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member

I suspect the problem is the round trips back and forth between multiprecision and floats are not idempotent, especially when combined with the application of a transform matrix and its inverse. I think it might be true that if I did the successive steps all in multiprecision, without the intermediate trips to float and back, that it would work exactly as expected: the subsequent operations would be no-ops.

I further suspect that the the trip back to float causes a well-formed (that is, manifold and volume enclosing) mesh to become non-well-formed, taking it into the territory that boolean is not guaranteed to work in. Hence the final result being seeming nonsensical.

The paper that I got the algorithm from warned that this could happen, and has an expensive, not-guaranteed-to-work workaround where they snap to float precision while still in multiprecision, and then check for self-intersections, and if they are found, redoes the whole thing again to resolve those self intersections. I skipped doing that step because it seemed pretty expensive even to detect the self intersections. Maybe I will add it in the future, perhaps as optional. I'd like to see if this actually occurs in real production uses rather than in contrived tests, before taking that step.

At this time I'm not going to verify the guesses I've made above because it would likely take days of my time (I already spent days on the last one, and gave up because it just got too hard to understand the topology of the intermediate results). Maybe some day I'll develop a new way of debugging that will let me tackle this. Perhaps a way to "expand" really tiny or narrow triangles while keeping the topology the same, so that I can examine them visually in Blender. Until then, I don't know what state to leave this in. I guess it is a low priority bug.

I suspect the problem is the round trips back and forth between multiprecision and floats are not idempotent, especially when combined with the application of a transform matrix and its inverse. I think it might be true that if I did the successive steps all in multiprecision, without the intermediate trips to float and back, that it would work exactly as expected: the subsequent operations would be no-ops. I further suspect that the the trip back to float causes a well-formed (that is, manifold and volume enclosing) mesh to become non-well-formed, taking it into the territory that boolean is not guaranteed to work in. Hence the final result being seeming nonsensical. The paper that I got the algorithm from warned that this could happen, and has an expensive, not-guaranteed-to-work workaround where they snap to float precision while still in multiprecision, and then check for self-intersections, and if they are found, redoes the whole thing again to resolve those self intersections. I skipped doing that step because it seemed pretty expensive even to detect the self intersections. Maybe I will add it in the future, perhaps as optional. I'd like to see if this actually occurs in real production uses rather than in contrived tests, before taking that step. At this time I'm not going to verify the guesses I've made above because it would likely take days of my time (I already spent days on the last one, and gave up because it just got too hard to understand the topology of the intermediate results). Maybe some day I'll develop a new way of debugging that will let me tackle this. Perhaps a way to "expand" really tiny or narrow triangles while keeping the topology the same, so that I can examine them visually in Blender. Until then, I don't know what state to leave this in. I guess it is a low priority bug.
Howard Trickey changed title from Exact Boolean with Incorrect Result to Exact Boolean with Incorrect Result - multiprecision/float round trips not exact 2021-02-07 14:44:13 +01:00
Philipp Oeser removed the
Interest
Modeling
label 2023-02-09 15:28:52 +01:00
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
3 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#82903
No description provided.