WebGCode DocsLocal-Only
Return to Editor

WebGCode 2 Documentation

Last updated February 25, 2026

Overview#

WebGCode 2 is a local-only CNC engineering tool. Parser, validation, simulation, and rendering run entirely in the browser runtime.

The editor text is the source contract. Everything downstream is deterministic projection: diagnostics, toolpath segments, playback state, and visualization.

Supported G-code#

Motion simulation is currently implemented for rapid, linear, and circular interpolation paths.

gcode
G0  X10 Y10 Z5
G1  X50 Y10 F800
G2  X70 Y30 I10 J0
G3  X50 Y50 I0 J10
G90 ; absolute mode
G91 ; incremental mode

Additional setup/spindle codes are parsed and validated against the machine profile, but may be non-geometric in current viewer output.

Simulation Model#

The engine is segment-based and line-mapped. Each segment keeps source line index, distance, and duration metadata.

pipeline
Monaco Editor
 -> Parse (line tokenizer)
 -> Validate (machine constraints)
 -> Generate segments
 -> Build simulation steps
 -> Render in Three.js

Playback and scrub operate over explicit indices for repeatable behavior across machines.

Machine Profiles#

  • Axis bounds for X/Y/Z
  • Units (`mm`/`inch`)
  • Maximum feed and spindle constraints
  • Supported G/M command sets

Profile edits re-run validation and simulation immediately against the current editor buffer.

File Import / Export#

Supported export types: .gcode .gc .ngc .txt.

  • Import via browser File API only
  • Export via Blob + object URL + hidden anchor
  • Original line ending style (`LF` / `CRLF`) preserved
  • No comment removal and no formatting rewrite

Limitations#

  • Geometric simulation only, no material removal model
  • No collision solver or fixture collision analysis
  • Large file responsiveness depends on browser + GPU budget

FAQ#

Is any G-code transmitted to a server?

No. The app is local-only at runtime.

Why is a command flagged unsupported?

The active machine profile defines allowed command lists.