compas-dev / compas-dev/compas

Intersection functions sometimes do not provide correct results with relative and absolute tolerance

Open
#1,320 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
386
Forks
122
Avg merge
11d 46m
Merged PRs (30d)
1

Description

**Describe the bug**

Tolerance comparison might not work anymore if coordinate values are high, but geometry is tiny.

**To Reproduce**
```
>>> from compas.geometry import Point, Line, intersection_segment_segment
>>> l1 = Line(Point(x=2687403.6546, y=1169130.8538, z=0.0), Point(x=2687403.6428, y=1169130.8540, z=0.0))
>>> l2 = Line(Point(x=2687403.6408, y=1169130.8538, z=0.0), Point(x=2687403.6509, y=1169130.8544, z=0.0))
>>> intersection_segment_segment(l1, l2, tol=1e-3)
(None, None)
```
**Expected behavior**

The intersection point should be `[2687403.64386, 1169130.85398, 0.0]`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.