isl-org / isl-org/Open3D

open3d.t.geometry.TriangleMesh.boolean_intersection hangs forever

Open
#7,170 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
14k
Forks
2.6k
Avg merge
5d 18h
Merged PRs (30d)
6

Description

### Checklist

- [x] I have searched for [similar issues](https://github.com/isl-org/Open3D/issues).
- [x] For Python issues, I have tested with the [latest development wheel](https://www.open3d.org/docs/latest/getting_started.html#development-version-pip).
- [x] I have checked the [release documentation](https://www.open3d.org/docs/release/) and the [latest documentation](https://www.open3d.org/docs/latest/) (for `main` branch).

### Describe the issue

Call to `open3d.t.geometry.TriangleMesh.boolean_intersection` hangs forever with the inputs below. Probably some check is missing and `vtkBooleanOperationPolyDataFilter ` is eventually called with bad input data. I thought it might have to do with [this VTK warning](https://vtk.org/doc/nightly/html/classvtkBooleanOperationPolyDataFilter.html): "This filter is not designed to perform 2D boolean operations, and in fact relies on the inputs having no co-planar, overlapping cells.".

### Steps to reproduce the bug

```python
import open3d as o3d
Ra = [[0.7763932909764589, 0.6302487268743537, 0.0],
[-0.6302487268743537, 0.7763932909764589, 0.0],
[0.0, 0.0, 1.0]]
Rb = [[0.932249806137092, -0.3618152829239726, 0.0],
[0.3618152829239726, 0.932249806137092, 0.0],
[0.0, 0.0, 1.0]]
obb_a = o3d.geometry.OrientedBoundingBox(center=[1.6146446239451142, 0.28286344833944177, 0.007205603424467633], extent=[0.11741286554647978, 0.05476615015653086, 0.014411206848935265], R=Ra)
obb_b = o3d.geometry.OrientedBoundingBox(center=[1.6095394270157695, 0.3750636665091013, 0.006781576251261745], extent=[0.12141223692202752, 0.07709698213053162, 0.01356315250252349], R=Rb)
mesh_a = o3d.geometry.TriangleMesh.create_from_oriented_bounding_box(obb_a)
mesh_a_t = o3d.t.geometry.TriangleMesh.from_legacy(mesh_a)
mesh_b = o3d.geometry.TriangleMesh.create_from_oriented_bounding_box(obb_b)
mesh_b_t = o3d.t.geometry.TriangleMesh.from_legacy(mesh_b)
isect = mesh_a_t.boolean_intersection(mesh_b_t) # This line hangs forever!
```

### Error message

Code hangs forever

### Expected behavior

Code finishes execution, possibly with an error message on bad inputs.

### Open3D, Python and System information

```markdown
- Operating system: Ubuntu 22.04 / macOS 10.15 / Windows 10 64-bit
- Python version: Python 3.10.12 (main, Jan 17 2025, 14:35:34) [GCC 11.4.0]
- Open3D version: 0.19.0
- System architecture: x86
- Is this a remote workstation?: no
- How did you install Open3D?: pip
```

### Additional information

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.