import-examples/12-15-import-formats/Ip023.stl
Sources
- Pattern-mined from mikedh/trimesh, `models/two_objects_mixed_case_names.stl` (`tests/test_stl.py`) + STL binary/ASCII-detection folklore (MIT — pattern only, no bytes copied).
Description
A binary STL's free-text 80-byte header happens to begin with the literal word "solid" (many CAD/CAM exporters write a human-readable string like `solid NAME exported by TOOL` into the otherwise-arbitrary binary header). A content-sniffer that decides ASCII-vs-binary by checking whether the file's first bytes spell "solid" mis-routes this file to the ASCII parser, which then fails to make sense of the binary triangle payload (or aborts outright). Second STL-format fixture in the corpus; the first exercising the binary variant and its detection heuristic.
Reproducer recipe
a well-formed binary STL (80-byte header + `uint32` triangle count + 50-byte triangle records) whose header text is deliberately set to `"solid exported by dodgy-step-files binary STL generator tool v1"` — a legal binary STL that happens to start with the ASCII bytes "solid".
Expected kernel behavior
detect binary-vs-ASCII by structure (does `84 + 50*count` equal the file length?) rather than by sniffing a leading "solid" token; a leading "solid" byte sequence must never be sufficient evidence that a file is the ASCII variant.
Notes
Cross-oracle: trimesh 4.12.2 loads the file correctly as a single-triangle mesh (`vertices.shape==(3,3)`, `faces.shape==(1,3)`) despite the "solid"-prefixed header — verified 2026-07-17. Positive/reference result: `exchange/stl.py::load_stl` tries `load_stl_binary` first and only falls back to `load_stl_ascii` on a `HeaderError` (structural header-vs-filesize mismatch), so it is immune to the naive "leading solid token" heuristic that trips up simpler sniffers. Synonyms: "binary STL solid header trap", "ASCII vs binary STL misdetection", "leading solid token false positive", "STL format-sniffing by structure not prefix". Provenance tier: bytes-only. First binary-STL fixture in the corpus.
Expected validation
Provenance tier
bytes-only — defect not fully embodied in fixture bytes.
Byte assertions
contains(b'solid exported by dodgy-step-files')
Live oracle output
No live oracle data — run _run_corpus to populate.
Fixture content
Show fixture bytes (with defect highlighting)
1solid exported by dodgy-step-files binary STL generator tool v1 ? ? ?