Me822 — does_polygon_soup_self_intersect_intersection_detection: crossing XY/XZ triangle pair in soup triggers triangle_soup_self_intersections (Branch 3)

§12.14 mesh defects (sub-class: polygon-soup-self-intersection / intersection-detection)

units

Sources

Description

Four triangles in a polygon soup: a crossing XY/XZ pair (t0 and t1 sharing apex v0=(0,0,0)) that geometrically pierce each other, plus two clean companion triangles 20 units away. The crossing pair causes `triangle_soup_self_intersections` to return a non-empty result — Branch 3 fires and the function reports that the soup self-intersects. The clean companions confirm the SI is localised to the two crossing triangles.

Reproducer recipe

v0=(0,0,0) apex; v1=(1,1,0), v2=(1,-1,0) XY fan; v3=(1,0,1), v4=(1,0,-1) XZ fan; t0=(v0,v1,v2), t1=(v0,v3,v4); clean t2,t3 at y≥20; assert_triangles_self_intersect(0,1); assert_triangles_do_not_intersect(2,3); assert_triangle_not_reachable_from(2,0).

Expected kernel behavior

Branch 3 fires; triangle_soup_self_intersections detects the crossing pair; function returns true (soup has SI).

Expected validation

Live oracle output

No live oracle data — run _run_corpus to populate.

Fixture content

Show fixture bytes
1{
2  "vertices": [
3    [
4      0.0,
5      0.0,
6      0.0
7    ],
8    [
9      1.0,
10      1.0,
11      0.0
12    ],
13    [
14      1.0,
15      -1.0,
16      0.0
17    ],
18    [
19      1.0,
20      0.0,
21      1.0
22    ],
23    [
24      1.0,
25      0.0,
26      -1.0
27    ],
28    [
29      0.0,
30      20.0,
31      0.0
32    ],
33    [
34      1.0,
35      20.0,
36      0.0
37    ],
38    [
39      0.0,
40      21.0,
41      0.0
42    ],
43    [
44      0.0,
45      22.0,
46      0.0
47    ],
48    [
49      1.0,
50      22.0,
51      0.0
52    ],
53    [
54      0.0,
55      23.0,
56      0.0
57    ]
58  ],
59  "triangles": [
60    [
61      0,
62      1,
63      2
64    ],
65    [
66      0,
67      3,
68      4
69    ],
70    [
71      5,
72      6,
73      7
74    ],
75    [
76      8,
77      9,
78      10
79    ]
80  ],
81  "metadata": {
82    "id": "Me822",
83    "schema_version": 0,
84    "defect_class": "self_intersection",
85    "title": "does_polygon_soup_self_intersect intersection_detection: crossing XY/XZ triangle pair in soup triggers triangle_soup_self_intersections (Branch 3)",
86    "assertions": [
87      {
88        "kind": "triangles_self_intersect",
89        "triangles": [
90          0,
91          1
92        ]
93      },
94      {
95        "kind": "triangles_do_not_intersect",
96        "triangles": [
97          2,
98          3
99        ]
100      },
101      {
102        "kind": "triangle_not_reachable_from",
103        "target": 2,
104        "source": 0
105      }
106    ]
107  }
108}