STEP (.step, .stp) as a part card
A .step or .stp file (ISO 10303-21 text) opens on its blob page as a card of facts about the part. Source is one tap away. No geometry is drawn.
On the web
Open the file. The card shows, as rows:
- the header's schema, name, description, time stamp, author and organisation, the system that wrote it and the length unit (each only when the file says it, none invented);
- how many entities the file holds, in how many types;
- the 20 most common entity types with their counts, and "N more types" past those;
- the PRODUCT names, the first 50, and "N more" past those.
The sample repository of a preview has part.step to try it on.
What is read
readStep in src/web/render/step.ts reads, with no dependency, the HEADER section's FILE_DESCRIPTION, FILE_NAME (name, time stamp, author, organisation, system) and FILE_SCHEMA, then scans DATA once for #n=NAME( entities, PRODUCT('name' and the length unit (SI_UNIT or CONVERSION_BASED_UNIT on the first LENGTH_UNIT() entity, looked at within 1,000 characters, so a hostile file costs linear time). It is a summary, not a parse: a #n=NAME( inside a quoted string is counted too.
A file that does not open with ISO-10303-21;, has no HEADER, or whose HEADER never ends is shown as text, with the reason. Over 5 MB the card is not made and the source is shown.
In the terminal
Open the file from a repository in forge over SSH: the same facts, entity types and products as a two-column table (src/tui/screens/workspace.ts, sharing readStep and stepFacts with the web).