Find if two triangles intersect in 3D environment

  • Thread starter Thread starter NotASmurf
  • Start date Start date
  • Tags Tags
    3d Triangles
NotASmurf
Messages
150
Reaction score
2
Hey all, I need to know when two triangles intersect in a 3D environment, given the 3 points. Any help apreciate have been stuck on this for a long time,
 
Mathematics news on Phys.org
NotASmurf said:
Hey all, I need to know when two triangles intersect in a 3D environment, given the 3 points. Any help apreciate have been stuck on this for a long time,
It is a tedious process.
Step one. Get the equations of the planes containing the triangles.
Step two. Compute the line of intersection of these planes.
Step three. Find the points of intersection of this line with each of these triangles. If either miss you are done, since the triangles can't overlap.
Step four. These intersection points define a pair of intervals (one for each triangle). If the intervals overlap, the triangles overlap along this overlap interval. Otherwise they do not overlap.
 
mathman said:
Step two. Compute the line of intersection of these planes.
How does one do that? I know gettign the cross product of the normals will get the direction but How would one find a point on both? if there's an algorithmic way that woudl be great as this is for a program I am writing.
 
NotASmurf said:
How does one do that? I know gettign the cross product of the normals will get the direction but How would one find a point on both? if there's an algorithmic way that woudl be great as this is for a program I am writing.
Take the two equations for the planes. Arbitrarily set one coordinate to 0. Now you have 2 equations in 2 unknown coordinates. Solving will give you the other 2 coordinates for that point.
 
Are you given three points per each triangle? ie six points total?

Also are you finding IF they intersect or WHERE they intersect?

You know that the triangles exist on specific planes, and that planes stretch to infinity. One way to determine if the triangles DO NOT intersect is to determine if the normal vectors of each triangle-plane are parallel. If the normal vectors are not parallel, then the triangles might intersect. At which point, you need to determine if the lines/vectors formed by the sides of any triangle intersect the area of the other triangle.

For coding purposes/idiot proofing a special circumstance you might want to keep in mind is if the distance between the planes and or triangles is zero... which means you're analyzing the same area.
 
NotASmurf said:
How does one do that? I know gettign the cross product of the normals will get the direction but How would one find a point on both? if there's an algorithmic way that woudl be great as this is for a program I am writing.
If you intend to write a computer code, you must take care of special cases. The planes may be parallel. The line of intersection may be constant in one or two coordinates.
 
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Fermat's Last Theorem has long been one of the most famous mathematical problems, and is now one of the most famous theorems. It simply states that the equation $$ a^n+b^n=c^n $$ has no solutions with positive integers if ##n>2.## It was named after Pierre de Fermat (1607-1665). The problem itself stems from the book Arithmetica by Diophantus of Alexandria. It gained popularity because Fermat noted in his copy "Cubum autem in duos cubos, aut quadratoquadratum in duos quadratoquadratos, et...
Thread 'Imaginary Pythagorus'
I posted this in the Lame Math thread, but it's got me thinking. Is there any validity to this? Or is it really just a mathematical trick? Naively, I see that i2 + plus 12 does equal zero2. But does this have a meaning? I know one can treat the imaginary number line as just another axis like the reals, but does that mean this does represent a triangle in the complex plane with a hypotenuse of length zero? Ibix offered a rendering of the diagram using what I assume is matrix* notation...

Similar threads

Back
Top