-
Notifications
You must be signed in to change notification settings - Fork 113
Closed
Description
Describe the bug
If the closest_point_on_segment_xy is one of the endpoints, it is returned with z coordinate different than 0.
This is because the logic returns the endpoint as-is, without zeroing the Z coordinate.
To Reproduce
from compas.geometry import Point, Line, closest_point_on_segment_xy
def test_closest_point_segment_xy():
point = Point(0, 0, -10)
line = Line([1, 1, -15], [10, 10, 20])
ponl= closest_point_on_segment_xy(point, line)
assert ponl == Point(1, 1, 0)it returns
=============================== FAILURES ================================
_________________ test_closest_point_segment_xy ________________________
def test_closest_point_segment_xy():
point = Point(0, 0, -10)
line = Line([1, 1, -15], [10, 10, 20])
ponl = closest_point_on_segment_xy(point, line)
> assert ponl == Point(1, 1, 0)
E assert Point(1.000, 1.000, -15.000) == Point(1.000, 1.000, 0.000)
E Use -v to get the full diff
Metadata
Metadata
Assignees
Labels
No labels