Find if two triangles intersect in 3D environment

  • Context: Undergrad 
  • Thread starter Thread starter NotASmurf
  • Start date Start date
  • Tags Tags
    3d Triangles
Click For Summary

Discussion Overview

The discussion revolves around determining the intersection of two triangles in a 3D environment, focusing on the mathematical and algorithmic approaches to solve this problem. Participants explore the necessary steps and considerations for implementing a solution in programming.

Discussion Character

  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant outlines a four-step process to determine triangle intersection, starting with obtaining the plane equations and computing the line of intersection.
  • Another participant seeks clarification on how to compute the line of intersection of the planes, specifically how to find a point on both planes after determining the direction using the cross product of normals.
  • A different participant questions whether the goal is to find if the triangles intersect or where they intersect, emphasizing the importance of the normal vectors of the triangle planes and their potential parallelism.
  • It is suggested that if the normal vectors are not parallel, the triangles might intersect, and further analysis is needed to check if the sides of the triangles intersect within the area of the other triangle.
  • Concerns are raised about special cases in coding, such as handling parallel planes and constant coordinates in the line of intersection.

Areas of Agreement / Disagreement

Participants express various viewpoints on the methods to determine triangle intersection, indicating that there is no consensus on a single approach or solution. Multiple competing methods and considerations are presented.

Contextual Notes

Limitations include the need for clarification on specific algorithmic implementations and the handling of edge cases, such as parallel planes and special coordinate conditions.

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 would 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 would 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 would 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.
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 59 ·
2
Replies
59
Views
230K
  • · Replies 38 ·
2
Replies
38
Views
6K
Replies
1
Views
2K
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 6 ·
Replies
6
Views
3K