mesh-examples/12-14-mesh/Me435.mesh.json
Sources
- MeshFix `checkAndRepair::forceNormalConsistence` Branch 6 (*VERTEX_ORDER_CORRECTION*: `if (tmp1 == -1 || tmp2 == -1) { p_swap(e->v1, e->v2)
- }`)
- `MESH_HEAL_COVERAGE.md`.
Description
Three consistently-oriented triangles (all +z normals) forming an open strip. t0=(v0,v1,v2), t1=(v1,v3,v2), t2=(v1,v4,v3). t0 and t1 share edge (v1,v2) in opposite senses (manifold-correct), but the half-edge's stored v1/v2 direction doesn't match the propagator's traversal convention → tmp1==-1 triggers p_swap. t1 and t2 share edge (v1,v3) similarly. All normals are +z (dot > 0.99 for both adjacent pairs). Two interior edges n=2; five boundary edges n=1. VERTEX_ORDER_CORRECTION is distinguished from Branches 1-3 (triangle inversion) by producing consistent normals (dot > 0) rather than antiparallel ones.
Reproducer recipe
v0=(0,0,0), v1=(1,0,0), v2=(0.5,1,0), v3=(1.5,1,0), v4=(2,0,0); t0=(v0,v1,v2), t1=(v1,v3,v2), t2=(v1,v4,v3); interior edges (v1,v2),(v1,v3) n=2; assert_adjacent_triangles_normal_dot_gt(0,1,0.99); assert_adjacent_triangles_normal_dot_gt(1,2,0.99).
Expected kernel behavior
Branch 6 fires; p_swap(e->v1, e->v2) corrects the half-edge's stored direction to match the adjacent triangle's winding expectation.
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 1.5, 20 1.0, 21 0.0 22 ], 23 [ 24 2.0, 25 0.0, 26 0.0 27 ] 28 ], 29 "triangles": [ 30 [ 31 0, 32 1, 33 2 34 ], 35 [ 36 1, 37 3, 38 2 39 ], 40 [ 41 1, 42 4, 43 3 44 ] 45 ], 46 "metadata": { 47 "id": "Me435", 48 "schema_version": 0, 49 "defect_class": "inconsistent_face_orientation", 50 "title": "forceNormalConsistence vertex-order-correction: half-edge direction misaligned; tmp==-1 triggers p_swap (Branch 6)", 51 "assertions": [ 52 { 53 "kind": "edge_shared_by_n_triangles", 54 "edge": [ 55 1, 56 2 57 ], 58 "n": 2 59 }, 60 { 61 "kind": "edge_shared_by_n_triangles", 62 "edge": [ 63 1, 64 3 65 ], 66 "n": 2 67 }, 68 { 69 "kind": "adjacent_triangles_normal_dot_gt", 70 "triangles": [ 71 0, 72 1 73 ], 74 "threshold": 0.99 75 }, 76 { 77 "kind": "adjacent_triangles_normal_dot_gt", 78 "triangles": [ 79 1, 80 2 81 ], 82 "threshold": 0.99 83 }, 84 { 85 "kind": "edge_shared_by_n_triangles", 86 "edge": [ 87 0, 88 1 89 ], 90 "n": 1 91 }, 92 { 93 "kind": "edge_shared_by_n_triangles", 94 "edge": [ 95 0, 96 2 97 ], 98 "n": 1 99 }, 100 { 101 "kind": "edge_shared_by_n_triangles", 102 "edge": [ 103 2, 104 3 105 ], 106 "n": 1 107 }, 108 { 109 "kind": "edge_shared_by_n_triangles", 110 "edge": [ 111 1, 112 4 113 ], 114 "n": 1 115 }, 116 { 117 "kind": "edge_shared_by_n_triangles", 118 "edge": [ 119 3, 120 4 121 ], 122 "n": 1 123 } 124 ] 125 } 126}