Me780 — polygon_soup_to_polygon_mesh orientation_inconsistency: adjacent t0=(v0,v1,v2) CCW and t1=(v1,v3,v2) opposing winding trigger orient_polygon_soup (Branch 1)

§12.14 mesh defects (sub-class: inconsistent-winding / polygon-soup-orientation)

topology

Sources

Description

Two adjacent triangles sharing edge (v1,v2) with opposing winding. Triangle t0=(v0,v1,v2) has normal +Z (CCW). Triangle t1=(v1,v3,v2) has normal −Z, making the polygon soup orientation inconsistent across the shared edge. The soup-to-mesh converter must call orient_polygon_soup before building the half-edge structure → Branch 1 fires. Shared edge (v1,v2) n=2; four boundary edges n=1. Euler: V=4, E=5, F=2, chi=1.

Reproducer recipe

v0=(0,0,0), v1=(1,0,0), v2=(1,1,0), v3=(0,1,0); t0=(v0,v1,v2) CCW normal +Z; t1=(v1,v3,v2) normal −Z; assert_edge_shared(v1,v2,2); boundary edges n=1; adjacent_triangles_inconsistent_winding(t0,t1); euler V=4,E=5,F=2,chi=1.

Expected kernel behavior

Branch 1 fires; orient_polygon_soup is called to rewind t1 so that the shared edge is traversed in opposite directions by the two adjacent polygons; conversion then proceeds.

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      1.0,
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      1,
32      3,
33      2
34    ]
35  ],
36  "metadata": {
37    "id": "Me780",
38    "schema_version": 0,
39    "defect_class": "inconsistent_winding",
40    "title": "polygon_soup_to_polygon_mesh orientation_inconsistency: adjacent t0=(v0,v1,v2) CCW and t1=(v1,v3,v2) opposing winding trigger orient_polygon_soup (Branch 1)",
41    "assertions": [
42      {
43        "kind": "edge_shared_by_n_triangles",
44        "edge": [
45          1,
46          2
47        ],
48        "n": 2
49      },
50      {
51        "kind": "edge_shared_by_n_triangles",
52        "edge": [
53          0,
54          1
55        ],
56        "n": 1
57      },
58      {
59        "kind": "edge_shared_by_n_triangles",
60        "edge": [
61          0,
62          2
63        ],
64        "n": 1
65      },
66      {
67        "kind": "edge_shared_by_n_triangles",
68        "edge": [
69          1,
70          3
71        ],
72        "n": 1
73      },
74      {
75        "kind": "edge_shared_by_n_triangles",
76        "edge": [
77          2,
78          3
79        ],
80        "n": 1
81      },
82      {
83        "kind": "adjacent_triangles_inconsistent_winding",
84        "triangles": [
85          0,
86          1
87        ]
88      },
89      {
90        "kind": "euler_characteristic",
91        "v": 4,
92        "e": 5,
93        "f": 2,
94        "chi": 1
95      }
96    ]
97  }
98}