-
Notifications
You must be signed in to change notification settings - Fork 0
user guide
This guide covers every feature of the G-code Pen Plotter app, tab by tab.
- Quick start
- Wave tab — 3D audio visualizer
- G-code tab — preview, export & image tracing
- Serial tab — plotter connection
- Gen Art tab — generative art algorithms
- Settings that apply everywhere
npm install
npm run devOpen the URL shown in the terminal (usually http://localhost:5174).
Fastest path to a plot:
- Wave tab — choose Noise Generator as Source, pick a Shape, click Record
- Orbit the 3D preview, then click Pattern → G-code
- G-code tab — click Export G-code, send the file to your plotter
The Wave tab captures audio (or generates algorithmic noise) and visualizes it as 3D geometry you can export to G-code.
| Option | Description |
|---|---|
| Noise Generator | Fully algorithmic; reproducible from a seed; no microphone required |
| Microphone | Live audio from getUserMedia via Web Audio API AnalyserNode |
| Type | Description |
|---|---|
| Perlin fBm | 2D Perlin noise scrolling over time; configurable octaves and persistence |
| Sine Sum | Sum of seed-derived harmonics with random frequency ratios and phase offsets |
| White Noise | xorshift32 PRNG; maximally random |
The same seed and settings always produce the same output and the same plot.
Fifteen built-in visualization modes map audio frames to different 3D geometry. Custom shapes can be added via the Plugin system (see below).
| Shape | Description |
|---|---|
| Linear | Stacked horizontal wave rows (Joy Division style) |
| Circular | One concentric ring per frame; amplitude modulates radius |
| Spiral | All frames joined into one continuous outward spiral |
| Lissajous | Left vs right channel XY scatter/trace; one curve per frame |
| Terrain | Horizon-masked ridges with painters-algorithm depth occlusion |
| Landscape | Terrain with opaque black fill polygons and perpendicular crest lines |
| Harmonograph | DFT-derived two-pendulum parametric curve with exponential damping |
| Moiré | Two offset families of concentric rings producing interference fringes |
| Heatmap | Frequency spectrogram grid; amplitude controls circle radius per cell |
| Quantized Noise | Joy Division ridges snapped to 8 amplitude bands; gap regions hatched |
- Select a Source and Shape.
- Click Record — captures frames at the configured fps (default 10). Recording auto-stops at Max Frames.
- While recording, the 3D scene builds in real time.
- Click Record again to stop early.
| Gesture | Action |
|---|---|
| Left drag | Orbit (rotate camera around scene) |
| Right drag | Pan (translate camera) |
| Scroll | Zoom in / out |
| Button | Description |
|---|---|
| Pattern → G-code | Projects the 3D scene through the current camera view to a 2D NDC set and sends it to the G-code tab (monoscopic) |
| Pattern → Stereo | Same but generates two slightly offset views (±0.325 units) for red-cyan anaglyph glasses; produces a two-pass G-code file with an M0 pen-change pause between passes |
Click Advanced to reveal:
| Setting | Description |
|---|---|
| Data Mode | Time-domain, Frequency (FFT), or Stereo |
| Noise type / Seed / Speed / Frequency / Octaves / Persistence | Tune the noise generator |
| Max Frames | How many frames to capture before auto-stop |
| Amp Scale | Vertical amplitude multiplier |
| FFT Size | Frequency resolution (power of 2) |
| Record FPS | Frames captured per second |
| Smoothing | Web Audio smoothing constant |
| Camera | Copy/paste the current camera position and target for reproducible compositions |
Install custom 3D shapes at runtime without modifying the app.
- Click Plugins in the sidebar.
- Paste ES module source code or click Load file.
- Click Install — the shape appears immediately in the Shape dropdown and is saved in
localStorage.
See Visualization Plugin API for the full developer guide.
The G-code tab previews, exports, and imports G-code for your plotter.
The canvas shows pen paths mapped to A4 paper (210×297 mm, 10 mm margins) with correct aspect-ratio scaling. Paths are rendered as cyan lines; the paper boundary is shown as a grey rectangle.
Navigation: scroll to zoom, drag to pan; click Reset zoom to fit.
Click Play to animate the G-code execution:
- Cyan lines — pen-down (drawing) moves
- Dashed grey lines — pen-up (travel) moves
- Red dot — current pen position
- Speed slider — controls animation rate (1×–100×)
- Optimize toggle — reorders paths using the nearest-neighbour sort to minimise travel distance; shows percentage of travel saved
Click Import and select an existing .gcode file to preview it in the canvas. Imported paths replace the current pattern.
Click Export G-code to download a GRBL-formatted .gcode file. The file includes:
- Paper dimensions, plot area, and margins as comments
- Generation parameters (algorithm, all param values) as comments
-
G21(mm),G90(absolute positioning) - Pen-up moves as
G0, pen-down drawing asG1 - Configurable feedrate and pen-up/down method (Z axis or servo)
- Final
G0 X0 Y0return to machine home andM2end
Filenames are three words derived deterministically from all generation parameters so that identical settings always produce the same filename.
Click Image → G-code to open the image tracing dialog.
- Upload a raster image (JPEG, PNG, etc.).
- Adjust tracing settings:
| Setting | Description |
|---|---|
| Threshold (0–255) | Binarization cutoff; pixels above threshold become ink |
| Invert | Swap black and white |
| Simplify | Path simplification strength; higher = fewer points |
| Smooth | Number of spline smoothing passes |
| Min points | Minimum vertices per contour to keep |
| Fill mode |
none = outline only; horizontal / cross / grid = hatch fill patterns |
| Hatch spacing | Distance between hatch lines (mm) |
| Shade levels | 1–4 grayscale passes; each pass uses M0 for a manual pen swap |
- The live preview updates as you adjust settings.
- Click Apply to send the traced paths to the G-code canvas.
Multi-pass shading produces one pen-down layer per brightness band. The plotter pauses at each M0 so you can swap pens (e.g. dark → medium → light ink) for simulated grayscale.
The Serial tab streams G-code directly to a connected plotter over USB serial.
Browser requirement: Web Serial API requires Chrome or Edge on a secure origin (
https://orhttp://localhost).
- Ensure your plotter is connected via USB.
- Click Connect and select your port from the browser dialog.
- The app communicates at 115200 baud (standard GRBL).
Click Send to stream the current G-code to the plotter line-by-line, waiting for GRBL's ok acknowledgment before sending the next line. A progress indicator shows position in the file.
| Button | Description |
|---|---|
| Home | Runs GRBL homing cycle ($H); requires limit switches |
| Zero X,Y | Sets current position as X0 Y0 origin |
| Zero Z | Sets current Z as Z0 |
| Pen Up | Lifts pen to configured up position |
| Pen Down | Lowers pen to configured down position |
| Frame | Traces the bounding box of the current plot with pen raised (to verify paper placement) |
| Sweep S | Ramps servo from S0→S1000→S0 to find min/max servo range |
| Cal | Draws a series of horizontal marks across Y to calibrate servo tilt compensation |
Use the Jog controls to move the pen head manually in X/Y/Z by the selected step size (0.1 mm to 10 mm).
A scrolling log shows all commands sent and GRBL responses received. Useful for debugging connection issues.
| Setting | Description |
|---|---|
| Feedrate | Plotter drawing speed (mm/min) |
| Pen mode |
Z axis (uses G0/G1 Z moves) or Servo (uses M3 S commands) |
| Pen up Z / down Z | Z positions for Z-axis pen lift |
| Pen up S / down S | Servo values for servo pen lift |
| Y compensation slope | Servo correction for tilt (µS per mm of Y travel) |
The Gen Art tab generates mathematical art as plotter-ready 2D paths.
Select from 10 built-in algorithms or any user-installed plugins.
| Algorithm | Description |
|---|---|
| Reaction Diffusion | Gray-Scott reaction-diffusion simulation; presets for Spots, Maze, Fingerprints, Coral |
| Noise Contours | Perlin noise iso-contours |
| Cyclic CA | Cyclic cellular automaton boundaries |
| Superformula | Gielis superformula polar curves |
| L-System | Lindenmayer-system space-filling curves: Hilbert, Moore, Gosper, Peano |
| Strange Attractors | Lorenz, Rössler, Dadras, Chen, and other chaotic attractors |
| Harmonograph | Damped two-pendulum parametric curves |
| Spirograph | Hypo- and epi-cycloid curves with ellipse stretch and multi-layer support |
| Julia Set | Julia set contours at configurable c values and presets |
| Space Filling | Hilbert / Gosper / other space-filling L-system curves |
The sidebar auto-generates controls from the algorithm's params definition:
-
Sliders —
rangeparams; drag or click to adjust -
Number inputs —
numberparams; type exact values -
Dropdowns —
selectparams; choose from a list; may auto-populate sibling params (presets) -
Checkboxes —
toggleparams
Algorithms that export a guide() function (currently Spirograph) show a dim dashed blue overlay on the canvas depicting construction geometry — the outer/inner ellipses and pen arm position. The guide updates live as you move sliders.
Click Generate to run the algorithm and display the paths on the canvas.
Enable Auto-generate to regenerate automatically 350 ms after any param change.
Click Send to G-code to transfer the current paths to the G-code tab. The export includes a metadata snapshot of the algorithm ID and all current param values as comments in the G-code file.
Install custom algorithms at runtime.
- Click Plugins in the sidebar.
- Paste ES module source or click Load file.
- Click Install — the algorithm appears in the dropdown immediately and is saved to
localStorage.
See GenArt Plugin API for the full developer guide and the examples/voronoi-cells.genart.js file for a worked example.
Some settings are shared across tabs:
| Setting | Where | Description |
|---|---|---|
| Paper size | G-code export | Default A4 (210×297 mm), 10 mm margins |
| Offset X / Y | G-code / Serial | Additional translation applied on export |
| Import scale | G-code | Scale factor when importing external G-code |
| Pen mode | Serial | Z-axis or servo pen lift method |
Settings are persisted in localStorage and survive page refreshes.