compas
compas copied to clipboard
Plane.is_parallel wrong result as given in the documentation
Describe the bug In the documentation of the example code. The result after running the method is False (latest compas2 from github.)
This method: https://github.com/compas-dev/compas/blob/main/src/compas/geometry/plane.py#L354
I think, instead of this:
return abs(self.normal.dot(other.normal)) == 1 - tol
it has to be:
return abs(self.frame.zaxis.dot(frame.zaxis)) >= 1 - tol
To Reproduce
plane1 = Plane.worldXY()
plane2 = Plane([1.0, 1.0, 1.0], [0.0, 0.0, 1.0])
result = plane1.is_parallel(plane2)
print(result)
prints False
Expected behavior prints True
Screenshots None
Desktop (please complete the following information):
- OS: [e.g. iOS] - Win
- Python version [e.g. 2.7] - 3.11.6
- Python package manager - conda
yes, the implementation is indeed wrong. will fix... thanks!
will change to abs(self.normal.dot(other.normal)) - 1 < tol
@tomvanmele I think you've addressed this in the compas.tolerance refactor?
yes indeed