Current in-progress path
All paths in the job
Current print state
Statistics accumulated while interpreting the job's G-code
Gets the total number of layers in the job
Number of layers
Checks if the job contains planar extrusion layers
True if the job contains at least one layer, false otherwise
Gets the slicer metadata (thumbnails, layer metadata, slicer name) for this job
The metadata, or undefined if none has been set
Sets the slicer metadata and forwards layer metadata to the layer indexer
Parsed slicer metadata
Gets paths organized by tool
2D array of paths, where each sub-array contains paths for a specific tool
Advances the job to the next command the interpreter executes
Called by the interpreter once per command, in file order. Every parsed
line yields exactly one command, so counting them gives the current line
index — which is how line-indexed slicer metadata is mapped onto the
command stream: extrusion dimension changes (;WIDTH: / ;HEIGHT:
comments) recorded at or before this line are folded into the state here.
The in-progress path is deliberately left alone: the move handlers break
it via continuePath when the state no longer matches, which keeps a
streamed parse identical to a one-shot parse — the interpreter resumes
the last path at every chunk boundary, undoing any break performed here.
Returns the path the next move of the given type should extend
Type of the move about to be added
The in-progress path when it can continue, otherwise a fresh one
The in-progress path continues only while its type and its extrusion
dimensions still match the state; dimension metadata that changed the
state since the path was started (see beginCommand) breaks it here, so
every path carries a single width and height. Deciding this lazily at
move time (and not when the metadata is applied) keeps streamed and
one-shot parses identical: the interpreter resumes the last finished path
at every chunk boundary, which would undo an eager break.
Derives the extrusion dimensions of the move about to be executed and folds them into the state, best-effort
The move's physical endpoint; an axis the move leaves unchanged carries the current (possibly unknown) state value
The filament length the move extrudes (see State.trackE)
Active only when the slicer metadata asked for it (Cura, whose files
announce no dimension comments); paths then carry these derived values as
their own, taking the same render-time precedence over the global
fallback as comment-announced dimensions do. Move handlers call this for
extruding moves before continuePath, so a change breaks the path
exactly like a ;WIDTH: / ;HEIGHT: comment would.
Layer height is the Z step between consecutive extrusion moves (the first one's Z stands in for the first layer). Only extrusion Zs are compared, so z-hop travels are invisible; a zero step (ironing, or printing on within the layer) and steps outside 0.01–1.0 mm (spiralize's continuous micro-climb, a probe artifact, moving down to a second sequential object) keep the current height.
Width comes from conservation of volume with a rectangular deposit cross-section — width = (ΔE × filament cross-section) / (length × height) — matching the box profile ExtrusionGeometry extrudes. The result is quantized to 0.01 mm and kept within 2% of the current width, so E-value rounding noise cannot break the model into micro-paths, and discarded entirely when implausible (outside 0.1–2.0 mm, or over a segment too short to measure).
Resolves the current state's position for rendering.
The position as concrete x, y, z numbers
Represents a complete print job containing paths, layers, and state
Remarks
Manages the collection of paths, organizes them into layers and tools, and tracks the current print state