0

I have two planes defined by three points each. These planes are "finite", meaning that the three points define their limits. These planes may or may not intersect, if so, the intersection is a finite line.

What's the smartest way to find the two end points of this intersection line?

Example:

planea = {(369.4956, 467.6504, 60.5147), (372.1940, 467.9910, 50.6351), (297.3370, 665.9444, 47.6697)}

planeb = {(198.1879, 626.4104, 59.6933), (199.4659, 620.8089, 38.2796), (398.9405, 661.8527, 62.6248)}

enter image description here

  • It seems that your "finite" planes are better described as triangles in 3D, together with the points "inside" each triangle (the convex combinations of a triangle's vertices). – hardmath Aug 20 '19 at 12:25
  • 1
    StackOverflow has this 2009 Question with activity from subsequent years, "Triangle Triangle Intersection in 3D Space". The same problems are discussed in various GameDev.SE posts like this one. – hardmath Aug 20 '19 at 12:57
  • Is it impossible for the two triangle to be coplanar? – amd Aug 21 '19 at 00:35
  • Yes, they may be planar and "far away" (no intersection), but if they intersect, they are not in the same plane. So I always expect a line segment as the intersection, and I need to have the two points of this segment as well. – Rafael March Aug 21 '19 at 08:10

1 Answers1

0

Here's a tedious way - perhaps not the "smartest" but probably quite fast enough in any programming language. It's all standard linear algebra (geometry in three dimensions).

First find the (equation of) the line of intersection of the planes determined by the two triangles.

Then find the (at most four) points where that line meets the edges of the triangles.

Two of those points will be the end points of the segment you seek.

At any stage of the calculation you may be able to conclude that the two triangles don't meet at all.

Ethan Bolker
  • 95,224
  • 7
  • 108
  • 199