Intersecting 3D polyhedra |
|
I have some polyhedra in 3D space. Some of these polyhedra are flat (2D) and some are not. But they are all defined as 30 (x,y,z) coordinates representing their vertices.
My aim is to be able to take 2 of these polyhedra and decide whether they overlap.
My approach so far has been to define polyhedra A as a series of lines (30) from the centre of the polyhedron to each vertex. I then check whether this line intersects polyhedra B using intersectLinePolygon3d. This is supposed to give me both the point of intersection and whether it is inside the 3d polygon. However, I think due to the fact that it projects all points onto one plance, in some cases this code claims the intersecting point is inside the polyhedron when it is not.
This means I now have a 'point of intersection' and my 2 polyhedra (x,y,z) points from before.
My next thought was to use IsInsidePolygon to check if this point is really inside the polyhedra...but again I face the 2 dimensionality issue of false positives.
Is there a completely alternative solution that would be better? Or a smaller fix that I could apply to my problem?
In summary, 2 questions that could solve my problem
Either
1) How do I find if 2 polyhedra intersect in 3D space?
2) How can I find if a point in 3D space is inside a 3D polyhedra?
|
Re: Intersecting 3D polyhedra |
|