Files

craft-stencilcraft-document

Shared StencilCraft document model, validation, geometry helpers, and native file codec. Applications re-export these model types rather than defining a second set of serializable document types. The .stencilcraft header and typed wire schema are provided by craft-stencilcraft-format.

The crate's Document::load_json and Document::save_json APIs read and write the versioned native format. File path I/O helpers preserve application paths in errors and use atomic writes.

The model stores each path once in Document.shapes. Organizational layers reference shape IDs through Layer.members; the independent, ordered Document.operations hold production passes with their own OperationSettings and shape memberships. A shape may belong to multiple layers or operations. Dangling or duplicate memberships are pruned on load and save.

Only format version 2 is supported. Files using the obsolete development schema (version 1) or any unsupported version are rejected; there is no migration or downgrade path.