import-examples/12-15-import-formats/Ip013.ply
Sources
- Pattern-mined from assimp/assimp#5341 downstream ("face list index ≥ declared vertex count", validation-caught but post-parse) (BSD-3-Clause — pattern only, no bytes copied).
Description
An ASCII PLY declares `element vertex 3` and a face row `3 0 1 5` — index `5` is ≥ the 3-vertex table. The PLY loader stores `vertex_indices` as raw integers with no bounds-check during `LoadVertex`/face assembly, so the out-of-range `5` is retained unvalidated inside the face array at parse — the same deferred behavior as the OFF loader (Ip010). The format's genuine contrast is with OBJ (Ip001/Ip006), whose loader validates each index as it reads it and rejects at parse. The retained bad index surfaces only when the face array is dereferenced (e.g. building `.triangles`).
Reproducer recipe
an ASCII PLY whose `vertex_indices` face list names an index ≥ the declared `element vertex` count.
Expected kernel behavior
validate every face index against the declared vertex count at parse time (as the OBJ loader does), not lazily on first dereference.
Notes
Cross-oracle: with trimesh 4.12.2, default `trimesh.load('…Ip013.ply')` raises `IndexError: index 5 is out of bounds for axis 0 with size 3` — but the raise fires inside `process()`/`merge_vertices`, NOT in the PLY loader: `trimesh.load(…, process=False)` returns a mesh whose `m.faces == [[0, 1, 5]]` (the out-of-range `5` retained unchecked), and the IndexError then defers until `m.triangles` dereferences it — re-verified 2026-08-12 (corrects an earlier note that read the deferral as a plain-load success and mis-cited OFF/Ip010 as parse-time-checking). The genuine contrast is OBJ (Ip001/Ip006), which raises even with `process=False` because its loader bounds-checks at parse; OFF-positive (Ip010) defers exactly like PLY. Synonyms: "PLY face index unvalidated on load", "deferred IndexError on triangles", "PLY vertex_indices OOB lazy failure", "process=False retains bad index". Provenance tier: bytes-only.
Expected validation
Provenance tier
bytes-only — defect not fully embodied in fixture bytes.
Byte assertions
contains(b'3 0 1 5')
Cross-references
Live oracle output
No live oracle data — run _run_corpus to populate.
Fixture content
Show fixture bytes (with defect highlighting)
1ply 2format ascii 1.0 3comment Ip013 assimp#5341 face list index >= declared vertex count (post-parse, unvalidated) 4element vertex 3 5property float x 6property float y 7property float z 8element face 1 9property list uchar int vertex_indices 10end_header 110.0 0.0 0.0 121.0 0.0 0.0 130.0 1.0 0.0 143 0 1 5