Skip to main content

Module native

Module native 

Source
Expand description

The native .og format: a whole document, written so it can be read back.

Topology, geometry, placements, per-entity tolerances, provenance and the cached tessellation: everything a Model holds. This is what the differential harness round-trips through, which sets the bar: a format that quietly dropped what it did not handle would make every comparison through it pass, including the ones that should not.

§Text, not binary

The point of a round trip is to disagree usefully when it goes wrong, and a disagreement you can only see through a hex dump is one nobody will read. So: one record per line, tagged, in dependency order: datums, geometry, entities, then topology. A model written, read and written again produces the same bytes, so diff is the whole comparison tool.

Floats are printed in Rust’s shortest round-tripping form, which is exact: parsing what this writes gives the same f64 back, bit for bit. It is not a lossy text approximation of a binary truth.

§Handles are preserved, not renumbered

A document’s entity identities are the thing references are recorded against (docs/DATA_MODEL.md §8). Rebuilding a model through the builders would mint fresh ones and quietly invalidate every reference in every document that pointed into it, so reading goes through Model::from_parts, which reproduces the arenas exactly and checks that every handle resolves.

§What it refuses

A representation, curve, surface or node kind this writer does not know how to write is an error, not a silent omission. That is the whole discipline of the format: write either produces a file that reads back as the same model, or it says it cannot.

Structs§

Absorbed
What an absorb produced: the transplanted roots, bound to the model that absorbed them, and where every absorbed identity ended up.
WriteOptions
What to include when writing.

Constants§

VERSION
The format version this writes.

Functions§

read
Read a model and its root shapes back.
read_document
Read a document back: the model plus everything over it.
read_into
Read a document’s contents into an existing model.
write
Write a model, and the shapes it is a document about.
write_document
Write a document: the model, then the product structure, appearance, names and PMI over it.