Intersection of two 3D Polyhedrons

Started by
15 comments, last by the_edd 12 years ago
Hello to all users,
I'm making a project for my university and I need to calculate the intersection of two given 3D polyhedrons. How can I do that?
I know the x,y,z, coordinates of each vertex and also the triangles list that I use to draw each polyhedron.
Any help would be very very appreciated.
With regard,
Dimitris
Advertisement
Ray to Triangle intersection: http://www.softsurfer.com/Archive/algorithm_0105/algorithm_0105.htm

good luck :)
This should work:
-Create from all the edges of your polyhedron Rays (make sure that the rays are not infinite, but have the length of the tested edge),
-Intersect them with all triangles of polyhedron.

Ray to Triangle intersection: http://www.softsurfe...orithm_0105.htm

Perhaps not the best approach, but it should work.

Good luck
Do you want the polyhedron of the intersecting volume of the two original polyhedrons, or just check if they do or do not intersect?
I want the polyhedron, not only check

I want the polyhedron, not only check


General polyhedron intersection is a very broad and complex problem, made even more complex when accounting for floating point inaccuracy. There's various libraries around with different characteristics. It gets even more complex if allowing degenerate and self-intersecting inputs.

Such operations are typically performed using CSG and polyhedra are only generated as final step. One disadvantage of such approach is that polyhedra aren't perfect fit, so there might be intersections left as result.


One way is to work on triangle soup. Intersect triangles, then run a post-processing pass to reconstruct final result. Quite a few simplifications can be made if limiting the solution to a well-defined problem, perhaps merely generating non-intersecting objects or similar.
On large scale multiple intersactions, won't that make the code very slow?
Live Television: http://www.hdlivestreams.com
Online Shopping: http://www.shoppynow.com

On large scale multiple intersactions, won't that make the code very slow?


Of course, but you are going for general intersection. Usually you do some filtering using convex hulls or bounding boxes/convex polyhedrons, and then you use the detailed mechanism only for the intersecting bodies
A popular way to do this is to generate a bsp tree of of your polyhedrons and then merge the trees in the appropriate way - google for BSP and CSG together to find details on how the two are used together.

If I was going to do this in a quick and dirty way, I would simply take the triangles of one of the polyhedra (the one with the fewest triangles), extend them to planes and split (look for "polyhedral splitting" - it is a well studied problem) the other polyhedron. Then all you have to do is classify the resulting small polyhedra as in or out of the polyhedron used to generate the splitting planes. This can be done with a simple point inside mesh query. Finally you take the "inside" polyhedra and work out the union of them, which isn't to hard since they share sides and don't overlap.
One question: any chance these are convex? That problem is much easier to solve.

This topic is closed to new replies.

Advertisement