isl-org / isl-org/Open3D

Boolean result not accurate.

Open
#5,922 6 comments 1 reaction 2 assignees Claimed by @jhunjhunwala1234 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](http://www.open3d.org/docs/latest/getting_started.html#development-version-pip).
- [X] I have checked the [release documentation](http://www.open3d.org/docs/release/) and the [latest documentation](http://www.open3d.org/docs/latest/) (for `master` branch).

### Describe the issue

I ran a boolean difference on the dog model and a box, and in the result additional meshes are created.
Expected output: clean cut (remaining just dog's head and feet)
Actual output: big triangle at dog's head and a line at dog's feet

![image](https://user-images.githubusercontent.com/120712750/219275449-d5cabf78-dbe0-4f89-bfd3-3fc570fcebc7.png)
![image](https://user-images.githubusercontent.com/120712750/219275641-8c7adf32-99d3-4ca7-948a-1053f48ac520.png)
![image](https://user-images.githubusercontent.com/120712750/219275794-060cefd2-a5a6-45d1-8de1-8533c365ee20.png)
![image](https://user-images.githubusercontent.com/120712750/219306291-154b2ef0-bce9-43d2-ab35-6767977ab6ff.png)

### Steps to reproduce the bug

```python
import open3d as o3d
import os, copy

# My local path
os.chdir('E:\\OneDrive\\Works_online\\STL')

target = o3d.io.read_triangle_mesh('3Dcube_dog5.stl')
target. Scale(0.5, center=target.get_center())
target2 = o3d.t.geometry.TriangleMesh.from_legacy(target)

box = o3d.geometry.TriangleMesh.create_box()
box. Scale(50, center=box.get_center())
box = copy.deepcopy(box).translate((0, 0, 0.01))
box2 = o3d.t.geometry.TriangleMesh.from_legacy(box)

ans = target2.boolean_difference(box2)

o3d.visualization.draw([{'name': 'difference', 'geometry': ans}])
```

### Error message

_No response_

### Expected behavior

Expected output: clean cut (remaining just dog's head and feet)
Actual output: big triangle at dog's head and a line at dog's feet

### Open3D, Python and System information

```markdown
- Operating system: Windows 11 64-bit
- Python version: Python 3.10.10
- Open3D version: 0.16.0
- System architecture: x86 / intel i7
- Is this a remote workstation?: no
- How did you install Open3D?: pip
```

### Additional information

I attach my 3d dog model.
[3Dcube_dog5.zip](https://github.com/isl-org/Open3D/files/10753653/3Dcube_dog5.zip)

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.