Shapes & spaces

Triangle mesh self intersection calculator with intersecting face pairs

Check all pairs of faces in a triangular mesh for improper intersections using exact rational predicates on the entered decimal coordinates.

Your numbers

Enter finite values within the stated bounds; coordinate rows may use commas.
One row of three zero-based vertex indices per face.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Check all pairs of faces in a triangular mesh for improper intersections using exact rational predicates on the entered decimal coordinates.

THE FORMULATest every face pair; allow only intersections contained in their indexed shared vertex or shared edge.

A worked example

The default two triangles cross along a segment and produce one improper face pair. A closed tetrahedron with only its intended shared edges produces zero.

Good to know

Up to100vertices and100nondegenerate triangular faces, valid zero-based indices and no duplicate faces. Finite decimal input converted to exact rationals. Indexed shared contacts allowed; geometric coincident vertices with different indices are not silently merged.

A mesh can be manifold and still cross itself

A combinatorially valid triangle mesh can pass through itself in space. Counting incident faces around edges checks connectivity, but does not test whether distant faces occupy the same geometric locations. This calculator examines that additional embedding question by checking every pair of triangles.

The output is a list of improper intersecting face pairs, not a repaired mesh. It can inspect open or closed meshes, provided their individual triangles are valid. A zero intersection count does not assert watertightness, outward orientation or suitability as a physical solid boundary.

A transverse face crossingImproper pair: 0,1Intersection: segmentExact decimal geometry
Scroll across to see the full diagram.
The two triangles meet along a segment that is not an indexed mesh edge.

Compare this with the Triangle triangle intersection calculator in 3D. Check all face pairs for improper intersections in a supplied mesh rather than intersect just one chosen pair of triangles.

Coordinates and indexed adjacency

Enter spatial vertices and a separate list of triangular faces. Face rows refer to zero-based vertex indices, and each face needs three distinct valid indices. Degenerate zero-area triangles and duplicate faces are rejected because their intended surface geometry is ambiguous.

Two faces sharing an indexed vertex or edge are expected to touch there. Identical geometric coordinates attached to different vertex indices are treated differently: they are not automatically stitched together. This distinction preserves the mesh topology you entered rather than silently changing connectivity to make an intersection disappear.

The crossing-triangle example

The default first triangle lies in the z-equals-zero plane. The second extends from below that plane to above it and crosses the first triangle's interior. Their geometric intersection is a segment, and the face pair is reported because it is not an intended indexed adjacency.

A tetrahedron gives a useful contrasting case. Each pair of adjacent faces shares its indexed boundary edge, and no pair intersects elsewhere. Those intended contacts are counted separately from improper crossings, so an ordinary tetrahedral boundary receives zero improper intersections despite many nonempty triangle-pair intersections.

Exact predicates after decimal parsing

Every finite decimal coordinate is converted to a rational number before the triangle intersection tests. Plane membership, side decisions and intersection construction then use rational arithmetic. This avoids a floating epsilon deciding whether an entered rational point lies exactly on a triangle's plane.

Exactness applies to the numbers entered, not to the physical objects they approximate. A measured coordinate rounded to six decimals represents that exact decimal here. The calculator cannot infer an uncertainty tolerance or decide that a tiny exact crossing should be ignored because it might be measurement noise.

Coplanar faces need special treatment

Triangles in distinct planes can meet in a point or a segment. Coplanar triangles can also overlap in a polygonal region, which requires planar clipping rather than a generic transverse line calculation. The result labels these cases so a flat overlap is not mistaken for a valid shared edge.

Even faces sharing an edge can be improper if both extend over the same planar area on one side of it. An intended adjacency permits contact along that shared edge only. It does not authorize one face to cover part of its neighbor's interior.

Reading and prioritizing the output

Each row identifies the two original face indices, an intersection classification and exact intersection vertices. Use those indices to locate the problem in the original mesh. A single folded region can generate several reported pairs, so the pair count is not the number of disconnected defects.

The checker deliberately leaves face order and vertex identities unchanged. Removing every reported triangle may destroy legitimate surface regions and create new holes. A repair workflow must decide whether the intended object requires welding vertices, changing connectivity, moving coordinates or discarding an incorrectly modeled component.

Additional checks for solid modeling

For a solid boundary, combine this test with edge-incidence, orientation and closedness checks. A nonintersecting open sheet still has no enclosed volume, while an inward-oriented closed surface needs a sign convention before mass properties are interpreted. These are complementary questions rather than interchangeable definitions of validity.

After any repair, rerun the checker on the resulting coordinates and faces. For large meshes, use a spatially accelerated dedicated library; this educational implementation has an explicit small-mesh bound and tests all face pairs. It does not handle continuously moving triangles or compute a collision time.

A few questions, answered

Does zero mean the mesh is watertight?

No. It means no improper face intersections were found; closedness and manifoldness are separate checks.

Are touching adjacent faces allowed?

Yes, when the contact lies on their indexed shared vertex or edge and does not include additional overlap.

Is a tiny crossing ignored?

No. Exact rational predicates apply to the entered decimals; no physical uncertainty tolerance is inferred.

Does the checker repair the mesh?

No. It reports face pairs and intersection geometry so you can choose an appropriate repair.

Find your calculator

Start typing to explore the library.