Skip to content

IR data model

Source: docs/10-dry-ir-v0-spec.md

3. Data model

3.1 Toolpath

FieldTypeNotes
versionu32IR schema version. v0 ⇒ 0. Always present on the JSON wire (even when 0).
metaMeta | absentOptional self-describing header (§3.2). Omitted entirely when absent.
segmentsarray of SegmentOrdered move stream. MAY be empty.

3.2 Meta

Optional provenance + declared invariants. Every field is omitted when empty, so a header-free toolpath has no meta key at all.

FieldTypeNotes
generatorstringProducing tool + version, e.g. "dry 0.2.0". Omitted when absent.
unitsstringLength unit of coordinates, e.g. "mm". Omitted when absent.
source_hashstringHex content hash of the source design. Omitted when absent.
invariantsarray of stringDeclared contract names the toolpath claims to satisfy. Omitted when empty.

3.3 Segment

One resolved move from start to end (absolute coordinates). An axis component is null when undefined before it is first set (e.g. the very first positioning move).

FieldTypePresenceNotes
start[number|null; 3]alwaysabsolute start (x, y, z)
end[number|null; 3]alwaysabsolute end (x, y, z)
travelboolalwaysnon-extruding positioning move
speednumberalwaysfeedrate (mm/min)
lengthnumberalwaystrue path length (arc length for arcs; 0 for a pure position)
volumenumberalwaysdeposited material volume (mm³)
filamentnumberalwaysfeedstock length consumed (mm)
widthnumber | nullalways (nullable)bead width
heightnumber | nullalways (nullable)layer height
kindstring enumomitted ⇒ "line"see §3.4
centre[number; 2] | nullomitted when nullarc centre (cx, cy); present only for arc
clockwiseboolomitted ⇒ falsearc direction: true ⇒ G2, false ⇒ G3
temperaturenumberomitted when unsetnozzle temperature (°C)
fannumberomitted when unsetpart-cooling fan (0..1)
flownumberomitted when unsetflow multiplier; default 1.0 is omitted
toolu32omitted when unsetactive tool index
dwell_snumberomitted when unsetdwell duration (s); present only for dwell
manual_gcodestringomitted when unsetverbatim g-code; present only for manualgcode (see §10)
orientation[number; 3]omitted when unsettool-direction unit vector (i,j,k); null/absent ⇒ +Z (3-axis)
control_points[[number; 3]]omitted when unsetspline control points; present only for spline

On the JSON wire, fields marked "omitted when unset/null" carry serde skip_serializing_if, so a motion-only toolpath serializes without any channel keys. start, end, width, height are always present but MAY be null (per component for the arrays).

3.4 SegmentKind

The eight resolved primitives. The on-wire encoding differs by format (this asymmetry is normative for v0 — see §10):

VariantJSON stringDRY0 dictionary stringDRY1 tag (u8)
Line"line"line0
Arc"arc"arc1
Spline"spline"spline2
Dwell"dwell"dwell3
Retract"retract"retract4
Unretract"unretract"unretract5
Deposit"deposit"deposit6
ManualGcode"manualgcode"manual_gcode7

A reader MUST reject any other JSON string, dictionary string, or tag (§11). An external implementation MUST map all three encodings of a given row to the same logical kind.