Me1031 — remove_invalid_polygons_degenerate_filter: duplicate-vertex triangle [v0,v0,v1] triggers remove_if predicate (Branch 1)

§12.14 mesh defects (sub-class: degenerate_triangle / remove-invalid-polygons-in-polygon-soup)

topology

Sources

Description

Polygon soup containing one valid triangle (v0,v1,v2) and one degenerate triangle with repeated vertex index [v0,v0,v1]. The repeated-vertex face is structurally a 2-vertex polygon; remove_if's predicate evaluates has_duplicate_vertex and returns true, marking it for erasure. Branch 1 fires. Triangle t1 has zero area because two indices are identical.

Reproducer recipe

v0=(0,0,0), v1=(1,0,0), v2=(0.5,1,0); t0=(v0,v1,v2) valid; t1=(v0,v0,v1) degenerate; assert_triangle_area_lt(t1,1e-9); edges (v0,v2) and (v1,v2) each n=1.

Expected kernel behavior

Branch 1 fires; remove_if predicate returns true for t1; t1 is moved to the tail of the polygon container for subsequent erase.

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  "triangles": [
20    [
21      0,
22      1,
23      2
24    ],
25    [
26      0,
27      0,
28      1
29    ]
30  ],
31  "metadata": {
32    "id": "Me1031",
33    "schema_version": 0,
34    "defect_class": "degenerate_triangle",
35    "title": "remove_invalid_polygons_degenerate_filter: duplicate-vertex triangle [v0,v0,v1] triggers remove_if predicate (Branch 1)",
36    "assertions": [
37      {
38        "kind": "triangle_area_lt",
39        "triangle": 1,
40        "lt": 1e-09
41      },
42      {
43        "kind": "edge_shared_by_n_triangles",
44        "edge": [
45          0,
46          2
47        ],
48        "n": 1
49      },
50      {
51        "kind": "edge_shared_by_n_triangles",
52        "edge": [
53          1,
54          2
55        ],
56        "n": 1
57      }
58    ]
59  }
60}