elif isinstance(a, Plane) and isinstance(b, ConvexPolygon):
return inter_plane_convexpolygon(a,b)
elif isinstance(a, ConvexPolygon) and isinstance(a, Plane):
return inter_plane_convexpolygon(b,a)
In the second elif statement, you can see that we are checking the type of a twice, without checking the type of b.
This should be changed to the following:
elif isinstance(a, Plane) and isinstance(b, ConvexPolygon):
return inter_plane_convexpolygon(a,b)
elif isinstance(a, ConvexPolygon) and isinstance(b, Plane):
return inter_plane_convexpolygon(b,a)
Until then, the work-around is to simply always specify the Plane first, and the ConvexPolygon second, so that you trigger the first elif, rather than the second.
There is currently a bug in the code for ConvexPolygon-Plane Intersection. This bug is caused by a minor typo, and can be fixed relatively easily.
If you look at line 98-101 in "Geometry3D/calc/intersection.py", you'll find this code:
In the second
elif
statement, you can see that we are checking the type ofa
twice, without checking the type ofb
.This should be changed to the following:
Until then, the work-around is to simply always specify the
Plane
first, and theConvexPolygon
second, so that you trigger the firstelif
, rather than the second.Thanks in advance!