cadmpeg-ir
The provenance-rich intermediate representation (IR) and codec contract at the heart of the cadmpeg CAD transcoder.
What the IR is
A decoded CAD document is a [CadIr]: units, tolerances, and an exact B-rep
stored as flat, id-referenced arenas following the ACIS/ASM topology
hierarchy body → region → shell → face → loop → coedge → edge → vertex, with
geometry attached by reference (surfaces, curves, pcurves, points). In v1,
entity provenance and exactness are stored in the sparse document-wide
[Annotations] tables, keyed by globally unique entity id. Records the
decoder recognized but could not interpret are preserved as
[UnknownRecord]s rather than dropped.
What is deliberately reserved
Feature history is represented as ordered, source-provenanced operations.
Assembly structure remains reserved. See docs/cad-ir.md.
The codec contract
Format plugins implement [Codec]: [Codec::detect], [Codec::inspect]
(container enumeration), and [Codec::decode] (into a [DecodeResult] with
an honest [DecodeReport]). [validate] checks a document with in-IR
arithmetic only.