Ip054 — 3MF degenerate triangle (two equal vertex indices) silently accepted

§12.15 import-format parser robustness (sub-class: degenerate-triangle)

P3 — cosmetic / metadata-only

spec-violation

Sources

Description

A 3MF mesh's final `<triangle>` names `v1="1" v2="1" v3="3"` — two of its three indices are equal, so it is a zero-area (degenerate) triangle. The 3MF Core spec explicitly requires the three indices of every triangle to be distinct; this is a 3MF-specific constraint that flat formats (OBJ/OFF/PLY) do not impose, so it is not exercised by Ip001/Ip010. A conforming loader must reject or drop the degenerate face; a lenient loader keeps it, silently changing the mesh's face set and area.

Reproducer recipe

an OPC/ZIP package (parts `[Content_Types].xml`, `_rels/.rels`, `3D/3dmodel.model`) with 4 `<vertex>` elements and 4 `<triangle>` elements where the last is `<triangle v1="1" v2="1" v3="3"/>` (v1==v2). Packed STORED with fixed 1980-01-01 timestamps so the malformed XML is literally present and the archive is byte-reproducible.

Expected kernel behavior

enforce the distinct-index rule — reject or drop the degenerate triangle with a diagnostic naming it; never let a zero-area face enter the mesh unremarked, where it corrupts normals, adjacency, and area/volume computations.

Notes

Cross-oracle: trimesh 4.12.2 (+networkx/lxml) silently loads 4 faces including the degenerate one — computed surface area 1.5000 vs 2.3660 for the valid tetrahedron, i.e. the wrong face silently enters the mesh with no diagnostic — verified 2026-08-11. Synonyms: "3MF degenerate triangle", "zero-area face repeated index", "triangle indices not distinct", "collapsed 3mf triangle". Provenance tier: bytes-only.

Expected validation

Provenance tier

bytes-only — defect not fully embodied in fixture bytes.

Byte assertions

Live oracle output

No live oracle data — run _run_corpus to populate.

Fixture content

Show fixture bytes (with defect highlighting)
1PK!=U!BB[Content_Types].xml<?xml version="1.0" encoding="UTF-8"?>
2<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
3<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
4<Default Extension="model" ContentType="application/vnd.ms-package.3dmanufacturing-3dmodel+xml"/>
5</Types>
6PK!\LH#_rels/.rels<?xml version="1.0" encoding="UTF-8"?>
7<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
8<Relationship Target="/3D/3dmodel.model" Id="rel0" Type="http://schemas.microsoft.com/3dmanufacturing/2013/01/3dmodel"/>
9</Relationships>
10PK!«ùi443D/3dmodel.model<?xml version="1.0" encoding="UTF-8"?>
11<model unit="millimeter" xml:lang="en-US" xmlns="http://schemas.microsoft.com/3dmanufacturing/core/2015/02">
12<resources>
13<object id="1" type="model">
14<mesh>
15<vertices>
16<vertex x="0" y="0" z="0"/>
17<vertex x="1" y="0" z="0"/>
18<vertex x="0" y="1" z="0"/>
19<vertex x="0" y="0" z="1"/>
20</vertices>
21<triangles>
22<triangle v1="0" v2="1" v3="2"/>
23<triangle v1="0" v2="1" v3="3"/>
24<triangle v1="0" v2="2" v3="3"/>
25<triangle v1="1" v2="1" v3="3"/>
26</triangles>
27</mesh>
28</object>
29</resources>
30<build><item objectid="1"/></build>
31</model>
32PK!=U!BB€[Content_Types].xmlPK!\LH#€s_rels/.relsPK!«ùi44€¢3D/3dmodel.modelPK¸