3dSynth

Docs / Custom G-code

Open in the interactive docs reader

Custom G-code Editor

The Custom G-code module lets you import, edit, analyze, and debug real G-code inside 3dSynth. Whether you need to tweak slicer output, hand-author toolpaths, or understand exactly what a G-code file does before printing, this module gives you professional-grade tools without leaving the app.

Core philosophy

Three principles guide the Custom G-code Editor:

  1. G-code is the single source of truth. The editor always works directly on the G-code text. There is no hidden intermediate format. What you see is what the printer receives.
  2. Bidirectional editing. Select lines in the editor and see them highlighted in the 3D viewer. Click a toolpath in 3D and the editor scrolls to that line. Text and visualization are always in sync.
  3. Motion-first thinking. The system understands movement, extrusion, temperature, and time -- not meshes or slicer intent. This makes it useful for any G-code, regardless of which slicer generated it.

What you can do

Supported firmware dialects

The editor auto-detects the firmware dialect from file headers and command patterns:

DialectDetectionNotes
MarlinSlicer headers, M900/M205 commandsMost common. Full support.
Klipperprinter.cfg references, {expression} syntaxMacro string parameters parsed; macros are never rewritten.
RepRap/DuetRRF headers, M552/M586 commandsRepRapFirmware conventions.
BambuProfile name / dialectPause uses M400 U1, never M600.

If the dialect can't be determined, the editor defaults to Marlin-compatible parsing. Unknown commands are flagged but never modified -- nothing is silently rewritten.

Supported file formats

ExtensionDescription
.gcodeStandard G-code (most slicers)
.gcoShortened G-code extension
.gRepRapFirmware convention
.ncNumerical control (CNC/legacy)
.3mf / .ufp / .zipContainer — G-code entry extracted; original bytes are not stored
.bgcodePrusa binary G-code (deflate / heatshrink decode; encode uncompressed or deflate)
.stl / .objThin mesh → planar contours (no supports)

Interface layout

When you select Custom G-code from the module picker, the left dock shows:

The 3D viewer is overlay-only for this module: click/hover a segment, isolate a range, measure two hits, and use the action HUD. Playback clips the overlay with setDrawRange (it does not rebuild geometry every tick).

Getting started

New to the G-code editor? Start with the Tutorial for a guided walkthrough, or jump to any of these pages: