compas icon indicating copy to clipboard operation
compas copied to clipboard

`is_coplanar` not working

Open ZacZhangzhuo opened this issue 1 year ago • 0 comments

https://github.com/compas-dev/compas/blob/05ef043486f19f22568dc798ed5881e80e10fd9c/src/compas/geometry/_core/predicates_3.py#L100

For example, if the number of points are four, it doesn't work.

To duplicate:

from compas.geometry import is_coplanar

points = [
    [0.2829517225424449, -4.839003403981526, 1.0982209046681721],
    [0.28995636105537415, -4.846865971883138, 1.1013225714365642],
    [0.2851504385471344, -4.84279203414917, 1.0995255708694458],
    [0.2909815311431885, -4.833856105804443, 1.1044467687606812],
]

print(is_coplanar(points, tol=1e-5))

Error:

line 136, in is_coplanar
    b = temp.pop(0)
IndexError: pop from empty list

ZacZhangzhuo avatar Dec 26 '23 15:12 ZacZhangzhuo