Me514 — Edge.swap TRIANGLE_ORIENTATION_FLIP: inconsistent winding across shared diagonal (v0,v2); both triangles traverse v2→v0, n0=+z n1=-z; t1.invert()+t2.invert() restore consistency (Branch 5)

§12.14 mesh defects (sub-class: edge-swap / orientation-flip)

topology

Sources

Description

A 2-triangle quad capturing the intermediate post-endpoint-swap, pre-invert defect state. Both triangles t0=(v0,v1,v2) and t1=(v3,v2,v0) traverse shared diagonal (v0,v2) in the same direction (v2→v0), giving t0 a +z normal and t1 a -z normal (dot=-0.75 < 0). The invert() calls on both triangles after edge replacement restore consistent winding.

Reproducer recipe

v0=(0,0,0), v1=(1,-1,0), v2=(0.5,1,0), v3=(0,1,0); t0=(v0,v1,v2), t1=(v3,v2,v0); assert_edge_shared(v0,v2,2); assert_adjacent_triangles_inconsistent_winding(0,1); four outer edges n=1; euler V=4,E=5,F=2,chi=1.

Expected kernel behavior

Branch 5 fires; t1->invert() and t2->invert() flip the vertex winding order of both new triangles; resulting mesh has consistent normals (all +z after inversion).

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      0.5,
15      1.0,
16      0.0
17    ],
18    [
19      0.0,
20      1.0,
21      0.0
22    ]
23  ],
24  "triangles": [
25    [
26      0,
27      1,
28      2
29    ],
30    [
31      3,
32      2,
33      0
34    ]
35  ],
36  "metadata": {
37    "id": "Me514",
38    "schema_version": 0,
39    "defect_class": "edge_swap_orientation_flip",
40    "title": "Edge.swap TRIANGLE_ORIENTATION_FLIP: inconsistent winding across shared diagonal (v0,v2); both triangles traverse v2\u2192v0, n0=+z n1=-z; t1.invert()+t2.invert() restore consistency (Branch 5)",
41    "assertions": [
42      {
43        "kind": "edge_shared_by_n_triangles",
44        "edge": [
45          0,
46          2
47        ],
48        "n": 2
49      },
50      {
51        "kind": "adjacent_triangles_inconsistent_winding",
52        "triangles": [
53          0,
54          1
55        ]
56      },
57      {
58        "kind": "edge_shared_by_n_triangles",
59        "edge": [
60          0,
61          1
62        ],
63        "n": 1
64      },
65      {
66        "kind": "edge_shared_by_n_triangles",
67        "edge": [
68          1,
69          2
70        ],
71        "n": 1
72      },
73      {
74        "kind": "edge_shared_by_n_triangles",
75        "edge": [
76          0,
77          3
78        ],
79        "n": 1
80      },
81      {
82        "kind": "edge_shared_by_n_triangles",
83        "edge": [
84          2,
85          3
86        ],
87        "n": 1
88      },
89      {
90        "kind": "euler_characteristic",
91        "v": 4,
92        "e": 5,
93        "f": 2,
94        "chi": 1
95      }
96    ]
97  }
98}