How this calculation works
Two triangular surfaces in three dimensions can miss, touch at one point, share a segment or overlap in a coplanar polygon. Checking only whether edges cross in a two-dimensional projection can produce false positives because projected points may lie at different depths. This calculator uses exact rational plane predicates and interpolation. For distinct planes it collects and verifies boundary-plane contacts inside both triangles; for coplanar input it clips one convex triangle by the other’s edge halfplanes. The result describes the intersection set, not a solid-volume overlap.
Intersect the two closed planar triangles; distinct supporting planes give at most a segment, while coplanar triangles can overlap in a polygon.A worked example
Let the first triangle be (0,0,0),(2,0,0),(0,2,0) and the second (0,0,0),(1,0,0),(0,1,0). They lie in the same plane and the second is contained in the first, so their intersection is the smaller three-vertex polygon. Moving the second triangle to z=1 makes the planes parallel and the intersection empty. A triangle crossing z=0 can instead meet the first in a segment, whose endpoints are obtained by exact plane interpolation and checked against both triangular boundaries.
Good to know
Two nondegenerate triangles, each exactly three rational Cartesian vertices. Degenerate point/segment triangles are rejected. Exact plane signs, rational interpolation and coplanar clipping distinguish all supported closed-set types; fraction-growth errors remain explicit. Polygon vertices are cyclic and segment endpoint orientation is arbitrary. No mesh boolean, solid-volume intersection, approximate collision tolerance, swept-motion prediction or uncertainty in measured coordinates is modeled.
Reference: CGAL — kernel intersection objects and 3D triangle cases (opens in a new tab) ↗
Separate the supporting-plane relation before clipping
A nonzero triangle normal comes from the cross product of two edges. The cross product of the two triangle normals then distinguishes parallel planes from a line of plane intersection. Parallel normals do not alone imply coplanarity: one triangle vertex must also satisfy the other plane equation. Exact rational signs avoid deciding a close but nonzero separation by an unstated floating tolerance.
For nonparallel planes, a triangle edge can cross the other plane, lie within it or touch it at an endpoint. Candidate points are retained only when they lie inside the other closed triangle. Repeating the construction in both directions captures overlap endpoints even when one triangle’s plane-intersection segment contains the other. The final points are checked against both plane and triangle constraints, and any collinear intermediate candidates reduce to the segment extremes.
Coplanar overlap is a two-dimensional set in a three-dimensional plane
When the planes coincide, there is no unique line along which to intersect the triangles. Convex polygon clipping in their shared plane can return up to six corners. The edge halfplane test uses the triangle normal, so no arbitrary coordinate projection needs to discard a dimension. Duplicate contacts and straight subdivisions are removed while preserving the actual rational boundary points of the overlap.
A nonempty intersection is not necessarily a positive-area polygon: shared vertices and shared edges are valid point and segment sets. Conversely, a polygonal overlap of two surfaces has no three-dimensional volume. The Point to triangle distance calculator in 3D solves a closest-point problem for one triangle; a zero distance alone would not reconstruct this full intersection set. This page makes the set dimension and coplanar status explicit so those tasks are not confused.
A few questions, answered
Does a shared edge count as an intersection?
Yes. The triangles are closed surfaces, so their edges and vertices are included. A shared edge is returned as a segment.
Why is a collinear input triangle rejected?
It is not a two-dimensional triangle surface and has no nonzero plane normal. Point/segment primitive intersections need a different input contract.