Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commitdd348ac6c3

README.md

intersect_core

The triangle pair tests of the intersect kernels. A pair of triangles, a of mesh A and b of mesh B, has a cut in parts; every part is a segment, and an endpoint is named by the edges or the corner it is made of, and computed from nothing else, so the triangles that share an edge compute the same point to the bit.

The includer binds apts, atri, bpts and btri. zi_part(a, b, part) answers part part as a ZiCut (ok when the part is present, and its endpoints e0 and e1). intersect_pairs and intersect_cuts include it.

Parts

PartWhatCuts
0The ordinary cut of two triangles that are not coplanar: the segment with two endpoints, each an edge of one triangle crossing the other (zi_pair). A vertex exactly on a plane counts as on its positive side, so triangles that only touch cross consistently or not at all.A and B
1 to 3Coplanar triangles: edge part - 1 of b, clipped to the closed triangle a.A
4 to 6Coplanar triangles: edge part - 4 of a, clipped to the closed triangle b.B
7 to 15Edge i of a and edge j of b lie in one plane and cross strictly inside both: the crossing, part 7 + 3 i + j. A segment of no length.A and B
16 to 24Corner v of a lies exactly strictly inside edge j of b: part 16 + 3 v + j. A segment of no length.A and B
25 to 33Corner v of b lies exactly strictly inside edge i of a: part 25 + 3 v + i. A segment of no length.A and B

Triangles are coplanar when neither is degenerate and every corner of each is exactly on the plane of the other (the signed volume is 0). Coplanar triangles have parts 1 to 6 and no part 0; a part is present when the clipped edge keeps a length. The clip is made in the projection along the axis the plane's normal points along most, with every edge taken from its lower point id to its higher; an edge is cut where it leaves the triangle by the line of an edge of the triangle.

Parts 7 to 33 split an edge: a cut point that lies on an edge is a point of every triangle that uses the edge, whatever plane that triangle lies in, so every pair of a triangle of A and a triangle of B that share the edges reaches it and reports the same point. A crossing is computed along the edge of A from the two edges alone.

Endpoint records

An endpoint is ZiEnd: its position, the kind word (the kind in the low byte, which meshes the segment cuts in bits 8 and 9, 1 mesh A, 2 mesh B, 3 both), lo, hi, tri and extra.

KindEndpointlo, hitri, extra
0an edge of A through triangle tri of Bthe edgetri, 0
1an edge of B through triangle tri of Athe edgetri, 0
3an edge of B crossing an edge of A in their planethe edge of Athe edge of B
4a point of Bits id, twice0, 0
5a point of Aits id, twice0, 0

Two endpoints with all of kind word, lo, hi, tri and extra equal are one point.