mesh-examples/12-14-mesh/Me1105.mesh.json
Sources
- MeshFix `Basic_TMesh.CreateTriangleFromVertices` Branch 6 (*UNLINKED_EDGE*) @ line 286 (`if (e1->t1 == NULL && e1->t2 == NULL) { E.freeNode(e1)
- ... }`)
- `MESH_HEAL_COVERAGE.md`.
Description
degenerate triangle td=(v0,v1,v2) has collinear vertices (Y=Z=0). CreateUnorientedTriangle returns NULL → Branch 4 null-guard fires. e3=(v0,v2) is shared with tc_a=(v0,va,v2) and is linked (n=2) → Branch 4 skips. e2=(v1,v2) is shared with tc_b=(v1,vb,v2) and is linked (n=2) → Branch 5 skips. Only e1=(v0,v1) is freshly created with no incident triangles → Branch 6 fires: e1->t1==NULL && e1->t2==NULL → freeNode(e1). The structural distinction: both e2 and e3 are pre-existing linked edges; Branch 6 is the only cleanup that actually frees an edge in this configuration.
Reproducer recipe
v0=(0,0,0), v1=(1,0,0), v2=(2,0,0), va=(1,2,0), vb=(1.5,2,0); tc_a=(v0,va,v2), tc_b=(v1,vb,v2); td=(v0,v1,v2) collinear; area_lt(td,1e-12); (v0,v2) n=2 (e3 linked); (v1,v2) n=2 (e2 linked); (v0,v1) n=1 (e1 orphan).
Expected kernel behavior
NULL return from CreateUnorientedTriangle; e3 linked → Branch 4 skips; e2 linked → Branch 5 skips; e1->t1==NULL && e1->t2==NULL → Branch 6 frees e1; vertex v0 and v1 edge-list refs to e1 are cleared.
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 2.0, 15 0.0, 16 0.0 17 ], 18 [ 19 1.0, 20 2.0, 21 0.0 22 ], 23 [ 24 1.5, 25 2.0, 26 0.0 27 ] 28 ], 29 "triangles": [ 30 [ 31 0, 32 3, 33 2 34 ], 35 [ 36 1, 37 4, 38 2 39 ], 40 [ 41 0, 42 1, 43 2 44 ] 45 ], 46 "metadata": { 47 "id": "Me1105", 48 "schema_version": 0, 49 "defect_class": "degenerate_triangle", 50 "title": "CreateTriangleFromVertices_unlinked_e1: degenerate td collinear; e3 and e2 linked; e1=(v0,v1) orphan freed by Branch 6 freeNode", 51 "assertions": [ 52 { 53 "kind": "triangle_area_lt", 54 "triangle": 2, 55 "lt": 1e-12 56 }, 57 { 58 "kind": "edge_shared_by_n_triangles", 59 "edge": [ 60 0, 61 2 62 ], 63 "n": 2 64 }, 65 { 66 "kind": "edge_shared_by_n_triangles", 67 "edge": [ 68 1, 69 2 70 ], 71 "n": 2 72 }, 73 { 74 "kind": "edge_shared_by_n_triangles", 75 "edge": [ 76 0, 77 1 78 ], 79 "n": 1 80 }, 81 { 82 "kind": "edge_shared_by_n_triangles", 83 "edge": [ 84 0, 85 3 86 ], 87 "n": 1 88 }, 89 { 90 "kind": "edge_shared_by_n_triangles", 91 "edge": [ 92 2, 93 3 94 ], 95 "n": 1 96 }, 97 { 98 "kind": "edge_shared_by_n_triangles", 99 "edge": [ 100 1, 101 4 102 ], 103 "n": 1 104 }, 105 { 106 "kind": "edge_shared_by_n_triangles", 107 "edge": [ 108 2, 109 4 110 ], 111 "n": 1 112 } 113 ] 114 } 115}