Skip to content

Repository files navigation

Inkline

The desktop app for pen plotter artists. Import SVGs, optimize toolpaths, preview animations, export validated G-code — all in one lightweight tool.

Built with Tauri + Svelte + Python + vpype.

Features

  • Full pipeline in one app — SVG import, path optimization, interactive editing, animated preview, G-code export, and direct serial plotting
  • Smart optimization — vpype-powered linemerge, linesort (with 2-opt refinement), and linesimplify with live parameter tuning
  • Animated toolpath preview — see exactly how your plotter will move before committing to a plot
  • G-code validation — catches out-of-bounds moves, missing pen-ups, and machine constraint violations before you waste paper
  • Interactive path editing — select, delete, reorder (drag-and-drop), transform paths with 50-level undo/redo
  • Multi-pen/color workflow — assign colors to layers, automatic pause between pen changes
  • Direct GRBL serial control — connect to your plotter and send G-code directly with pause/resume/cancel
  • Built-in generative sketch mode — JavaScript code editor with drawing API, simplex noise, parameter sliders, and one-click plot
  • Machine profiles — built-in profiles for Stepcraft and GRBL machines, plus custom profile editor for any machine
  • Cross-platform — macOS, Windows, and Linux

Quick Start

Desktop App

# Clone the repo
git clone https://github.com/zacclery/inkline.git
cd inkline

# Set up the Python backend
python -m venv .venv
source .venv/bin/activate
pip install -e .

# Run the desktop app (from the app/ directory)
cd app
npm install
npm run tauri dev

Note: The Tauri app must be run from the app/ directory, not the project root.

CLI

# Convert SVG to optimized, validated G-code
inkline convert input.svg -o output.nc --machine stepcraft-d600

# Customize optimization
inkline convert input.svg -o output.nc --merge-tolerance 1.0 --simplify-tolerance 0.2

# Validate an existing G-code file
inkline validate output.nc --machine stepcraft-d600

# Generate an animated HTML preview
inkline preview input.svg -o preview.html

# List available machine profiles
inkline machines

Python API

from inkline import STEPCRAFT_D600, read_svg, optimize, export_gcode, compute_stats

doc = read_svg("drawing.svg")
doc = optimize(doc, sort_paths=True, two_opt=True)

stats = compute_stats(doc, STEPCRAFT_D600)
print(f"Paths: {stats.num_paths}, Efficiency: {stats.efficiency:.1%}")
print(f"Est. time: {stats.est_total_time_min:.1f} min")

export_gcode(doc, "drawing.nc", STEPCRAFT_D600)

How It Works

                        ┌─────────────────────────────────────┐
                        │           Inkline App               │
                        │                                     │
 SVG files ────────────►│  Import ► Optimize ► Edit ► Preview │
                        │                                     │
 Sketch code ──────────►│  Generate paths ──────────┐         │
                        │                           ▼         │
                        │              Export G-code ──────────┼──► .nc file
                        │              Validate ───────────────┼──► Error report
                        │              Send serial ────────────┼──► GRBL plotter
                        └─────────────────────────────────────┘

The Python sidecar uses vpype for path optimization and vpype-gcode for G-code generation. The Tauri frontend provides the interactive GUI. Communication is via JSON-RPC over stdin/stdout.

Supported Machines

Machine Work Area Status
Stepcraft D600 420 x 600 mm Built-in
Stepcraft D420 300 x 420 mm Built-in
GRBL 3018 300 x 180 mm Built-in
GRBL 3040 400 x 300 mm Built-in
Any GRBL machine Custom Create via UI

Custom machine profiles are saved to ~/.inkline/machines/ and persist across sessions.

Architecture

┌──────────────────────┐     JSON-RPC      ┌──────────────────────┐
│   Tauri + Svelte     │ ◄──────────────── │   Python Sidecar     │
│                      │    stdin/stdout    │                      │
│  - Canvas preview    │                   │  - vpype pipeline    │
│  - Path editor       │                   │  - G-code export     │
│  - Sketch editor     │                   │  - Validation        │
│  - Animation         │                   │  - GRBL serial       │
│  - Controls/UI       │                   │  - Statistics        │
└──────────────────────┘                   └──────────────────────┘

Keyboard Shortcuts

Key Action
? Toggle help
V Select tool
G Move tool
S Scale tool
R Rotate tool
Delete Delete selected paths
Cmd+Z / Cmd+Shift+Z Undo / Redo
Cmd+A Select all
Arrow keys Nudge 1mm
Space Play/Pause animation
Cmd+Enter Run sketch

Dependencies

  • vpype — vector pipeline for pen plotters
  • vpype-gcode — G-code export plugin
  • pyserial — GRBL serial communication
  • Tauri — lightweight desktop app framework
  • Svelte — frontend framework

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages