G-code & toolpath basics
Companion notes for the dual-view visualizer: modal motion, arcs, feeds, time estimates, and what the risk flags mean.
Coordinates & modality
G21millimetres ·G20inchesG90absolute ·G91incrementalG17XY plane (arcs); G18/G19 supported only as chord approximations- Motion mode is modal: after
G1, further axis words keep feeding until another G0/G1/G2/G3
Motion words
G0 — rapid (non-cutting transit; time uses a high effective F) G1 — linear feed at F (typically mm/min or in/min) G2 — clockwise arc (XY): centre via I J (relative to start) or radius R G3 — counter-clockwise arc F — feed rate (modal) I J — arc centre offsets from start point (common CNC convention) R — arc radius (negative R selects the major arc)
The visualizer tessellates arcs into many short chords, colours by mode / feed / Z / time, and animates on a time-based timeline (scrubbable). Dual panes: 3D isometric + XY top.
Time estimate
t_segment ≈ length / (F_eff / 60)
Rapids use a high effective feed (≥ 3000 unit/min) when F is low. Real machines also accelerate and decelerate — wall-clock time is longer. No jerk model here.
Risk flags (heuristics)
- Rapid ending below Z = 0 (stock plane assumption)
- XY rapid while Z is negative (classic “crash while down”)
- Rapid plunge toward low Z
- Feed in stock shortly after a low rapid approach
- Extreme or tiny feed values; zero-length moves
These are not a CAM collision engine: no tool diameter, holder, clamps, or stock solid model.
SVG import
Paste d="M … L … Z" or a bare path. Strokes become feed moves at F800 for length/time demos.
Keyboard (visualizer)
Space play/pause R rewind F fit camera Ctrl+Enter parse
Open the G-code / Toolpath Visualizer and try the “Risky rapid plunge” sample.