Analysis and visualization
The Custom G-code Editor doesn't just display text — it understands the structure, timing, and physics of your G-code. This page covers the analysis and visualization tools that help you understand what a file does before (or after) you print it.
Structural outline
The Outline Panel on the left side of the editor shows a hierarchical tree of your G-code's structure:
File
Startup (lines 1–45)
Layer 0 (Z=0.200) (lines 46–320)
Skirt
Perimeter
Infill
Layer 1 (Z=0.400) (lines 321–590)
Perimeter
Infill
Support
...
Layer 142 (Z=28.600)
Shutdown (lines 28401–28450)
How it works
The structural analyzer detects sections from two sources:
- Z-height changes — each time the Z position increases, a new layer begins
- Slicer comments — the analyzer reads comment annotations from popular slicers
Supported slicer comment formats
| Slicer | Comment pattern | Example |
|---|---|---|
| Cura | ;TYPE:, ;LAYER:, ;MESH: | ;TYPE:WALL-OUTER |
| PrusaSlicer | ; TYPE:, ; LAYER_CHANGE | ; TYPE:Perimeter |
| OrcaSlicer | ; TYPE:, ; LAYER_CHANGE | ; TYPE:Inner wall |
| Simplify3D | ; layer, ; process | ; layer 1, Z = 0.300 |
You can also define custom section markers:
;--- SECTION: My custom region ---
G1 X10 Y20 E0.5
G1 X30 Y40 E1.0
;--- SECTION: Another region ---
Outline interaction
- Click any section to scroll the editor and highlight the toolpath
- Expand/collapse layers to drill into regions (perimeter, infill, support)
- Hover to see section metrics (time, extrusion, travel distance)
- Filter by typing in the search bar at the top
Each section type has a colored dot matching the Line Type color mode, so you can visually distinguish perimeters from infill from support at a glance.
Metrics panel
The Metrics tab in the dock shows computed statistics about the entire file — or just your selection.
Global metrics
| Metric | Description | Example |
|---|---|---|
| Print time | Estimated duration | 2h 15m 32s |
| Filament length | Total filament used | 12.45 m |
| Filament volume | Volumetric usage | 8.32 cm3 |
| Filament weight | Weight (if material density set) | 10.3 g |
| Lines | Total / command / comment / blank | 28,450 / 22,100 / 4,200 / 2,150 |
| Layers | Number of distinct Z heights | 142 |
| Extrusion distance | Total movement while extruding | 45.2 m |
| Travel distance | Total non-extrusion movement | 8.7 m |
| Travel / extrusion ratio | How much travel vs printing | 0.19 |
| Retractions | Count and total retraction distance | 1,240 / 6,200 mm |
| Avg flow | Average volumetric flow rate | 4.2 mm3/s |
| Peak flow | Maximum volumetric flow rate | 12.8 mm3/s |
| Avg speed | Average feedrate during extrusion | 2,400 mm/min |
| Peak speed | Maximum feedrate | 6,000 mm/min |
Print cost estimation
When you configure filamentCostPerKg in your printer settings (under material configuration), the Metrics panel shows an estimated print cost based on the computed filament weight. This updates live as you edit or when you select a portion of the file — so you can see what a specific section costs in material.
For example, with PLA at €25/kg and a print using 42g of filament, the panel shows: Est. Cost: €1.05
Time estimate vs slicer TIME
Print time uses a trapezoid + classic-jerk motion planner (defaults: accel 1000 mm/s², jerk 8 mm/s) and includes G4 dwells. The metrics panel shows naive (distance/feedrate), planned, and slicer ;TIME: / TIME when the file includes that metadata.
Charts
SVG charts (no extra chart library) in the Metrics tab:
- Layer time (bar per layer) and time-to-layer (cumulative)
- Flow and speed histograms
- Feature split (perimeter / infill / support / travel)
Selection-scoped metrics
Select any range of lines (in the editor or by clicking a section in the outline), and the Metrics panel switches to show statistics for just that selection. Sparse 3D brush selections use only the selected line indices, not the min–max span between them. This is useful for answering questions like:
- "How long does this layer take?"
- "What's the flow rate in this infill region?"
- "How many retractions happen in this section?"
- "How much does this section cost in filament?"
Color modes
The 3D viewer can color-map the toolpath by different machine state properties. Switch modes from the Color dropdown in the toolbar.
| Mode | Colors by | Gradient | What it reveals |
|---|---|---|---|
| Speed | Feedrate (F) | Blue (slow) to Red (fast) | Speed variation across the print |
| Extrusion rate | Volumetric flow | Blue (low) to Red (high) | Where the printer pushes the most plastic |
| Volumetric flow | Volumetric flow | Cool to Hot | Flow with threshold awareness |
| Acceleration | Acceleration setting | Green to Yellow to Red | Where acceleration limits may matter |
| Line type | Section type | Distinct per type | Perimeter vs infill vs support vs travel |
| Temperature | Nozzle target | Blue (cold) to Red (hot) | Temperature changes across the print |
| Fan | Fan speed | Gray (off) to Cyan (full) | Cooling strategy visualization |
| Layer index | Layer number | Rainbow cycle | Layer-by-layer progression |
| Bead | Extrusion width | Tube radius from estimated width | Bead tubes when segment count ≤ 80k; otherwise lines |
Playback controls
The playback bar sits between the editor and dock tools. As you play or scrub, the editor scrolls to the current line and the overlay clips with setDrawRange (geometry is not rebuilt every tick). At 1x, playback follows estimated print time (elapsedSeconds).
Controls
| Control | Action |
|---|---|
| Slider | Drag to any line in the file |
| Play/Pause | Animate the nozzle through the toolpath |
| Stop | Reset to show all lines |
| Step Forward | Jump to next command (skips blanks and comments) |
| Step Backward | Jump to previous command |
| Speed | 1x follows estimated print time (elapsedSeconds); 2x–50x scale that clock |
Jump-to buttons
Quick navigation to the next event of a specific type:
- Layer — jump to the next Z-height change
- Retract — jump to the next retraction event
- Temp — jump to the next temperature change
State display
During playback, the bar shows the current machine state:
X120.5 Y80.2 Z4.200 F2400 E1234.5mm 210°C Fan 100% 0:14:32
This updates in real time as you scrub or step through the file.
Inspection tooltip
Hover over any toolpath segment in the 3D viewer to see a tooltip with:
- Line number in the source file
- Raw G-code command text
- Speed (feedrate in mm/min)
- Flow (volumetric flow in mm3/s)
- Temperature (nozzle target in °C)
- Section label (e.g. "Layer 42 — Perimeter")
Click the segment to select it in the editor and jump to that line.
Hover is off while Brush Select or Measure is active so those tools can use the click.
Measure
Switch the viewport tool to Measure, then click two toolpath hits. The overlay shows straight-line distance (XYZ) between those states. A third click starts a new pair.