Skip to content
Sophie Déziel edited this page Sep 2, 2026 · 7 revisions

Welcome 👋

This wiki collects deep dives into the internals of gcode-preview: the math, the algorithms, and the performance work behind rendering G-code in the browser.

New to the codebase? Start with the architecture overview, then follow your curiosity.

The full pipeline at a glance. What happens between processGCode() and pixels on the canvas, which file owns what, and how the pieces talk to each other.

How extrusion paths become bead-shaped 3D meshes. Cross-sections, miter joins, coordinate frames, buffer layouts, and advice for contributors touching that math.

How circular arc moves become polylines. Recovering the center in R mode, chord-tolerance tessellation, helical Z interpolation, and the guards that keep hostile files from crashing the job.

Why the renderer stays fast. One merged mesh per tool color, the vertex-packing trick with its measured receipts, and how batching plays with progressive rendering.

A contributor recipe. The interpreter's handler registry, the four-file change to support a new command, and the conventions that keep handlers bug-free.

Moving an existing integration to 3.0. Every breaking change with before and after snippets: the new constructor, the async progressive renderer, and where all the settings moved.


Looking for usage docs instead? See the README and the API reference.

Clone this wiki locally