QH5 qhull precision error (qh_merge_twisted) with normal orientation
- 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
Oriententing normals leads to crash. Below is the exact code to reproduce the behavior every time.
### Steps to reproduce the bug
```python
import open3d as o3d
NORMAL_RADIUS = 0.12
ORIENT_K = 100
# load
pcd = o3d.io.read_point_cloud("1200_2040.pcd")
# normal estimation
pcd.estimate_normals(search_param=o3d.geometry.KDTreeSearchParamRadius(radius=NORMAL_RADIUS))
# normal orientation
pcd.orient_normals_consistent_tangent_plane(k=ORIENT_K)
```
### Error message
Traceback (most recent call last):
File "/home/mi/clemem10/lidar_simulator/surface_reconstruction/reproduce_bug.py", line 13, in
pcd.orient_normals_consistent_tangent_plane(k=ORIENT_K)
RuntimeError: QH5 qhull precision error (qh_merge_twisted): twisted facet f27000837 does not contain pinched vertices, nor is it near a neighbor. mindist -8.8e-10 maxdist 0 vertexdist 0.0014 maxpinched 6.4e-10 neighbor f27000836 mindist -1.3e-09 maxdist 0
ERRONEOUS FACET:
- f27000837
- flags: bottom newfacet tested newmerge
- merges: 1
- normal: 0.4549 0.7753 0.02898 -0.4371
- offset: -2129.859
- center: 1202.905008000002 2050.276650000003 76.64362400000013 21.13185690604281
- vertices: p662858(v1240000) p657730(v1203213) p662857(v1202834) p657728(v1147727) p657731(v973542)
- neighboring facets: f26226974 f27000835 f27000836 f27000833
- ridges:
- r314056 tested simplicialtop simplicialbot
vertices: p657730(v1203213) p662857(v1202834) p657731(v973542)
between f26226974 and f27000837
- r314053 tested
vertices: p657730(v1203213) p657728(v1147727) p657731(v973542)
between f27000837 and f26226974
- r345306 tested simplicialtop simplicialbot
vertices: p662858(v1240000) p662857(v1202834) p657731(v973542)
between f27000837 and f27000835
- r345303 nonconvex simplicialtop
vertices: p662858(v1240000) p657728(v1147727) p657731(v973542)
between f27000836 and f27000837
- r345305 nonconvex
vertices: p662858(v1240000) p657730(v1203213) p657728(v1147727)
between f27000836 and f27000837
- r345307 tested simplicialtop simplicialbot
vertices: p662858(v1240000) p657730(v1203213) p662857(v1202834)
between f27000837 and f27000833
ERRONEOUS OTHER FACET:
- f27000836
- flags: bottom newfacet newmerge
- merges: 1
- normal: 0.4549 0.7753 0.02898 -0.4371
- offset: -2129.859
- maxoutside: 3.818634e-11
- vertices: p662858(v1240000) p657730(v1203213) p657728(v1147727) p657731(v973542) p657732(v481036)
- neighboring facets: f25043484 f27000834 f26226972 f27000837 f27000831
- ridges:
- r345311 simplicialtop simplicialbot
vertices: p657728(v1147727) p657731(v973542) p657732(v481036)
between f25043484 and f27000836
- r345312 simplicialtop simplicialbot
vertices: p662858(v1240000) p657731(v973542) p657732(v481036)
between f27000836 and f27000834
- r345308 simplicialtop
vertices: p657730(v1203213) p657728(v1147727) p657732(v481036)
between f26226972 and f27000836
- r345303 nonconvex simplicialtop
vertices: p662858(v1240000) p657728(v1147727) p657731(v973542)
between f27000836 and f27000837
- r345305 nonconvex
vertices: p662858(v1240000) p657730(v1203213) p657728(v1147727)
between f27000836 and f27000837
- r345310 simplicialtop
vertices: p662858(v1240000) p657730(v1203213) p657732(v481036)
between f27000831 and f27000836
While executing: | qhull d Qbb Qt
Options selected for Qhull 2018.0.1.r 2018/12/28:
run-id 193310402 delaunay Qbbound-last Qtriangulate _pre-merge
_zero-centrum Pgood _max-width 57 Error-roundoff 3.6e-12
_one-merge 3.2e-11 _near-inside 1.6e-10 Visible-distance 2.1e-11
U-max-coplanar 2.1e-11 Width-outside 4.3e-11 _wide-facet 1.3e-10
Last point added to hull was p662858. Last merge was #64491.
At error exit:
Delaunay triangulation by the convex hull of 1285949 points in 4-d:
Number of input sites: 1240000
Total number of nearly incident points: 45949
Number of Delaunay regions: 0
Number of non-simplicial Delaunay regions: 23298
Statistics for: | qhull d Qbb Qt
Number of points processed: 1240000
Number of hyperplanes created: 26947693
Number of facets in hull: 7962034
Number of distance tests for qhull: 194735638
Number of distance tests for merging: 139201745
Number of distance tests for checking: 0
Number of merged facets: 64492
Maximum distance of merged point above facet: 5e-11 (1.4x)
Maximum distance of merged vertex below facet: -7.2e-11 (2.0x)
precision problems (corrected unless 'Q0' or an error)
1 flipped facets
36281 coplanar horizon facets for new vertices
### Expected behavior
_No response_
### Open3D, Python and System information
```markdown
- Operating system: Ubuntu 20.04
- Python version: '3.9.14 (main, Sep 7 2022, 23:43:56) \n[GCC 7.5.0]'
- Open3D version: 0.15.2
- System architecture: x86
- Is this a remote workstation?: no
- How did you install Open3D?: pip
```
### Additional information
File to reproduce: https://box.fu-berlin.de/s/Ngkf6Fzyn3PCdE9
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.