Me515 — Edge.swap INCIDENT_EDGE_UPDATE_E1: outer edges e1=(v1,v2) and e3=(v2,v3) each incident on one triangle; e1->replaceTriangle(t1,t2) and e3->replaceTriangle(t2,t1) complete adjacency update (Branch 6)

§12.14 mesh defects (sub-class: edge-swap / incident-edge-adjacency-update)

topology

Sources

Description

A 2-triangle quad sharing interior diagonal (v0,v2). The outer edges e1=(v1,v2) and e3=(v2,v3) each have n=1 (one incident triangle). Branch 6 fires as the final step of the swap, calling replaceTriangle on e1 and e3 to update their incident-triangle links: e1 loses t0 and gains the new t1, and e3 loses t1 and gains the new t0. The pre-swap diagonal has no (v1,v3) edge (n=0).

Reproducer recipe

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

Expected kernel behavior

Branch 6 fires; e1->replaceTriangle(t1,t2) and e3->replaceTriangle(t2,t1) update the half-edge adjacency so that the outer edges are correctly linked to their new owning triangles after the diagonal flip.

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      0.0,
11      0.0
12    ],
13    [
14      0.5,
15      1.0,
16      0.0
17    ],
18    [
19      -0.5,
20      0.5,
21      0.0
22    ]
23  ],
24  "triangles": [
25    [
26      0,
27      1,
28      2
29    ],
30    [
31      0,
32      2,
33      3
34    ]
35  ],
36  "metadata": {
37    "id": "Me515",
38    "schema_version": 0,
39    "defect_class": "edge_swap_incident_edge_update",
40    "title": "Edge.swap INCIDENT_EDGE_UPDATE_E1: outer edges e1=(v1,v2) and e3=(v2,v3) each incident on one triangle; e1->replaceTriangle(t1,t2) and e3->replaceTriangle(t2,t1) complete adjacency update (Branch 6)",
41    "assertions": [
42      {
43        "kind": "edge_shared_by_n_triangles",
44        "edge": [
45          0,
46          2
47        ],
48        "n": 2
49      },
50      {
51        "kind": "edge_shared_by_n_triangles",
52        "edge": [
53          1,
54          2
55        ],
56        "n": 1
57      },
58      {
59        "kind": "edge_shared_by_n_triangles",
60        "edge": [
61          2,
62          3
63        ],
64        "n": 1
65      },
66      {
67        "kind": "edge_shared_by_n_triangles",
68        "edge": [
69          0,
70          1
71        ],
72        "n": 1
73      },
74      {
75        "kind": "edge_shared_by_n_triangles",
76        "edge": [
77          0,
78          3
79        ],
80        "n": 1
81      },
82      {
83        "kind": "edge_shared_by_n_triangles",
84        "edge": [
85          1,
86          3
87        ],
88        "n": 0
89      },
90      {
91        "kind": "euler_characteristic",
92        "v": 4,
93        "e": 5,
94        "f": 2,
95        "chi": 1
96      }
97    ]
98  }
99}