Skip to main content

Module step

Module step 

Source
Expand description

A reader for STEP physical files (ISO 10303-21, the text form IFC files use): the header’s schema name and the DATA; section’s instances, #id = ENTITY(args);, with nested lists, strings, enums, $, *, references and typed values such as IFCLABEL('x').

The parser works on tokens with an explicit stack, so nesting costs no recursion; lists deeper than MAX_DEPTH are refused. Line breaks and comments may fall anywhere between tokens.

Structs§

Entity
One instance: its entity name in capitals and its parameters. A complex instance (#1=(A(..)B(..));) is named "" and holds its parts as typed values.
StepFile
A whole file: the schema names from FILE_SCHEMA and the instances by id.

Enums§

Value
One parameter of an instance.

Constants§

MAX_DEPTH
How deeply lists may nest inside one instance.

Functions§

decode_string
Decodes the escapes of ISO 10303-21 strings: \\, \S\c, \X\hh, \X2\hhhh…\X0\ and \X4\hhhhhhhh…\X0\; \P?\ code page switches are dropped. Bytes that are not escapes are read as UTF-8 (lossily), which many exporters write directly.
parse
Parses a STEP physical file.