Mega Search
23.2 Million


Sign Up

Make a donation  
Intersecting 3D polyhedra  
News Group: comp.soft-sys.matlab

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?

Vote for best question.
Score: 0  # Vote:  0
Date Posted: 26-Aug-2016, at 10:20 PM EST
From: browser
 
Re: Intersecting 3D polyhedra  
News Group: comp.soft-sys.matlab
I have read this post;

https://uk.mathworks.com/matlabcentral/answers/101396-is-there-a-function-in-matlab-for-detecting-points-inside-a-polyhedron

which seems to work if the polyhedron is not flat. But I get errors when it is flat

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 26-Aug-2016, at 11:13 PM EST
From: browser