Draw one layer of ir to ctx. Extrusion moves are colored via DrawLayerOptions.colorMode
(single-sourced with the 3D renderer); travel moves are drawn only when travel is given. The
caller is responsible for clearing the canvas and for capability-gating the color mode. Returns an
honest count; a missing/out-of-range layer draws nothing and reports drawn: false.
@chestnutlabs/gcode-renderer-2d — low-resource Canvas 2D layer renderer (DD-014 / E8).
An opt-in current/adjacent-layer 2D view over the existing
ToolpathIR, for low-GPU, low-memory, or WebGL-blocked devices (old mobile, embedded printer UIs, locked-down browsers). One parse, one IR, a second lightweight view — no second parser path, nothree, no framework. Per-segment color is single-sourced with the 3D renderer via@chestnutlabs/gcode-colors.Re-exports the color model so 2D consumers get
ColorMode/RGBfrom one import.