Skip to main content

Module metadata

Module metadata 

Source
Expand description

The Properties-panel DATA layer (UI comes later): a name-keyed metadata store, per-entity measurements, and object provenance — all engine-native, all crossing the R3 boundary as plain JSON/scalars.

§Metadata store (MetadataStore)

object name → { attribute → value }, keyed by the KERNEL OBJECT NAME (a solid / face / edge name), not a feature id. This loose coupling is the whole point: a record survives feature edits, rollback and re-tessellation as long as the object’s name persists (edge/face names ARE propagated through booleans, splits and welds by the kernel). Values are strings; the well-known density attribute (mass units per mm³) drives a solid’s weight. The store is persisted WITH the model — crate::engine_state::EngineState::history_request_json folds it in as a top-level metadata field and crate::engine_state::EngineState::set_history_json lifts it back out, so it round-trips through save/open.

§Measurements + provenance

The EngineState methods below resolve an object NAME to its kind (solid / face / edge, via the scene) and return the right measurements from the kernel’s exact integrators (volume, surface area, arc length), plus the feature that produced the object (provenance, via the history’s per-feature output solids). Units are millimetres (the kernel length convention).

Structs§

MetadataStore
The name-keyed metadata store: object name → { attribute → value }, string values, deterministic iteration (a BTreeMap so the persisted JSON is stable). Empty records are never retained (removing the last attribute drops the whole record).

Constants§

DEFAULT_DENSITY
The default density (mass per unit volume) when an object carries no density metadata: unit density, so weight == volume.