Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
cadmpeg-ir
cadmpeg-ir defines the format-neutral document exchanged by cadmpeg codecs.
It provides the CadIr data model, codec interfaces, validation, structural
diffing, JSON serialization, and explicit representations of source fidelity
and decode loss.
Schema detail lives in CAD IR version 7.
Install
Model
The topology graph follows
body → region → shell → face → loop → coedge → edge → vertex. Faces reference
surface carriers, edges reference curve carriers, coedges may reference
parameter-space curves, and vertices reference points. IDs are globally unique
within a document. Arena order is canonical after CadIr::finalize; every
arena is sorted lexicographically by entity ID.
Coordinates and linear quantities use millimeters. Angular quantities use
radians. Call validate_neutral after construction or transformation.
Constructors leave document invariants unchecked.
Construct and consume a document
Create and validate an empty current-version document:
use Units;
use ;
let mut ir = empty;
// Populate ir.model arenas and use typed IDs to connect entities.
let arena = new;
let = from_root_bytes?;
ir.finalize?;
let report = validate_neutral;
assert!;
assert_eq!;
CadIr::to_canonical_json clones and finalizes the document before it emits
pretty JSON. CadIr::from_json accepts exactly ir_version: "7".
The model.subds arena is required, including when empty. diff compares
units, tolerances, annotations, and entity arenas by stable identity.
Format crates implement the object-safe Codec trait. A consumer can select a
codec by detection confidence, inspect a container without decoding geometry,
then decode the selected source:
use ;
use ;
DecodeResult contains the finalized document, a DecodeReport, and a
SourceFidelity sidecar for provenance, conversion exactness, and retained
native records. CodecError covers wrong format, malformed container,
unsupported capability, and I/O failure. LossNote records transferred
information that was approximated or omitted. UnknownRecord retains an
uninterpreted source record by location, digest, links, and optional bytes.
Entity and field fidelity belongs in sidecar Annotations. Missing exactness
entries mean byte-exact. Other entries distinguish deterministic derivation,
inference, and unknown origin. Provenance entries identify source streams and
byte offsets.
Documentation
- API documentation
- CAD IR version 7
- Architecture and crate map
- Clean-room and legal policy
- Repository
Requires Rust 1.88 or later. Licensed under Apache-2.0.