Dry Machina Documentation & Specs

Dry Machina Documentation

Dry Machina (drymachina.com) is an open-source, multi-process CAM toolpath compiler, intermediate representation (IR), and generative manufacturing platform written in Rust with WebAssembly, TypeScript, and Python SDK bindings.

The Universal Manufacturing Compiler:
Just as LLVM abstracts machine assembly code across x86, ARM, and WebAssembly, Dry Machina abstracts machine motion across FDM 3D printers, subtractive CNC machining centers, diode/fiber lasers, plasma tables, and 6-axis industrial robotic arms.

Core Design Principles

  • Multi-Process Portability: Compile a single geometric intent into G-code for 3D printers (Klipper/Marlin/Bambu), CNC mills (RS-274/GRBL), laser cutters, plasma tables, and 5-axis robotic arms.
  • Provable Correctness: Deterministic lowering passes, mathematical proofs, continuous S-curve acceleration profiling, and physical machine capability gates.
  • Client-Side Zero-Latency WebAssembly: Run complex 3D toolpath compilation, collision checking, and G-code generation 100% locally in the browser with 0ms network latency.

Quickstart Guide

Choose your preferred programming language or tool to start authoring and compiling toolpaths:

import { Design, mm, mm_s, MachineCatalog } from '@dry/sdk';

// 1. Author a toolpath design
const design = new Design()
  .point(mm(0), mm(0), mm(0.2))
  .speed(mm_s(60))
  .point(mm(100), mm(0), mm(0.2))
  .point(mm(100), mm(100), mm(0.2))
  .point(mm(0), mm(100), mm(0.2))
  .point(mm(0), mm(0), mm(0.2));

// 2. Pre-flight check against machine limits
const catalog = new MachineCatalog();
const machine = await catalog.get('bambu-x1-carbon');
const report = design.checkCompatibility(machine.toCapabilities());

// 3. Emit G-code
if (report.compatible) {
  const gcode = design.gcode();
  console.log(gcode.join('\n'));
}
from dry import Design, mm, mm_s, MachineCatalog

# 1. Author a toolpath design
design = (
    Design()
    .point(mm(0), mm(0), mm(0.2))
    .speed(mm_s(60))
    .point(mm(100), mm(0), mm(0.2))
    .point(mm(100), mm(100), mm(0.2))
    .point(mm(0), mm(100), mm(0.2))
    .point(mm(0), mm(0), mm(0.2))
)

# 2. Check machine limits
catalog = MachineCatalog()
machine = catalog.get("bambu-x1-carbon")
report = design.check_compatibility(machine.to_capabilities())

# 3. Emit G-code
if report["compatible"]:
    gcode = design.gcode()
    print("\n".join(gcode))
# 1. Emit G-code from JSON toolpath
dry emit conformance/gcode/square.json --flavor klipper > output.gcode

# 2. Run pre-flight verification against machine limits
dry verify conformance/gcode/square.json --profile profiles/bambu_x1c.json

# 3. Inspect layer forensics & volumetric flow
dry trace conformance/gcode/square.json

Architecture & Multi-Dialect IR

The Dry compilation pipeline uses a strictly layered intermediate representation:

  • L1 (Design Intent): High-level authoring operations (e.g. move, arc, spline, pocket, tpms, speed, flow) independent of machine kinematics.
  • L2 (Resolved Toolpath): Fully sampled linear and arc segments with resolved Cartesian positions, volumetric extrusion ratios, and spindle power.
  • L3 (Motion Profile & Machine G-Code): Kinematically bounded moves with 7-phase S-curve profiles, corner deceleration, retraction hops, and dialect-specific formatting (Klipper, Bambu, RS-274, GRBL, KUKA KRL).

TypeScript SDK @dry/sdk

The official TypeScript SDK for Node.js and modern browser WebAssembly execution.

npm install @dry/sdk

Key exports include Design, MachineCatalog, computeSCurveProfile, importStepNc, TPMSGenerator, and units helpers (mm, inch, mm_s).

Python SDK dry

The high-performance Python SDK powered by native Rust PyO3 bindings.

pip install dry

Provides complete feature parity with the TypeScript and Rust layers, including FullControl Python design reproduction, TPMS field slicing, and machine profile verification.

Rust Core Crate dry-core

The foundational compiler crate providing pure Rust, zero-allocation data structures, serialization schemas, and motion optimizers.

[dependencies]
dry-core = { version = "0.7.0", path = "crates/core" }

Native CLI dry

Command-line interface for batch processing, automated CI/CD verification, and machine communication.

# Commands overview:
dry emit <INPUT.json> --flavor [klipper|bambu|marlin|grbl|rs274|krl]
dry verify <INPUT.json> --profile <PROFILE.json>
dry trace <INPUT.json>
dry login

3D Printing (FDM)

Supports non-planar toolpaths, continuous vase spirals, variable extrusion bead widths, dynamic cooling fan curves, and multi-material tool changes across Klipper, RepRap, Marlin, and Bambu Lab hardware.

CNC Milling (RS-274 / GRBL)

Supports canned drilling cycles (G81 standard drilling, G83 deep hole peck drilling), volumetric Material Removal Rate (MRR) computation, spindle cutting power estimation ($P_c = \frac{\text{MRR} \cdot k_c}{60 \cdot \eta}$), and cusp height surface roughness calculation.

Laser Cutting & Engraving

Supports dynamic spindle PWM power modulation (M3 S... / M4 S...), lead-in kerf compensation, air assist solenoid triggers, and continuous raster vectorization.

Plasma & Waterjet

Supports torch height control (THC) initial height sensing (IHS), pierce delay dwells (G4 P...), corner radius slowdown, and kerf width offsetting.

5-Axis Robotics & RTCP

Supports Rotation Tool Center Point (RTCP) kinematics, surface normal vector interpolation ($\vec{n} = [i, j, k]$), and native KUKA Robot Language (KRL LIN / PTP) emitter lowering.

7-Phase Jerk-Bounded S-Curve Motion (D4.5)

Dry Machina implements an analytical 7-phase S-curve profile solver that bounds jerk (\(\frac{da}{dt} \le j_{\max}\)), eliminating acceleration discontinuities that cause ringing, ghosting, and motor resonance.

import { computeSCurveProfile } from '@dry/sdk';

// Calculate smooth transition from 0 to 200 mm/s
// with a_max = 2000 mm/s², j_max = 20,000 mm/s³
const profile = computeSCurveProfile(0, 200, 2000, 20000);
console.log(`Duration: ${profile.total_duration}s, Peak Accel: ${profile.peak_acceleration} mm/s²`);

TPMS Implicit Slicing

Triply Periodic Minimal Surfaces (TPMS) generated directly from mathematical implicit field functions:

  • Gyroid: \(\sin(x)\cos(y) + \sin(y)\cos(z) + \sin(z)\cos(x) = C\)
  • Schwarz Diamond: \(\sin(x)\sin(y)\sin(z) + \sin(x)\cos(y)\cos(z) + \cos(x)\sin(y)\cos(z) + \cos(x)\cos(y)\sin(z) = C\)
  • Schwarz Primitive: \(\cos(x) + \cos(y) + \cos(z) = C\)

Stepped Pocketing Engine

Generates multi-pass rectangular and circular pocketing roughing toolpaths with constant radial engagement and customizable stepover and stepdown.

ISO 14649 STEP-NC Importer (D1.8)

Directly ingest enterprise CAD/CAM machining workingsteps (drilling cycles, planar facing, and closed pocket features) into Dry L1 operations:

import { importStepNc } from '@dry/sdk';

const xml = `<stepnc xmlns="urn:iso:std:iso-10303-14649">
  <workingsteps>
    <workingstep id="ws-1" type="hole" x="50" y="25" diameter="6.0" depth="15.0" feed="800"/>
  </workingsteps>
</stepnc>`;

const ops = importStepNc(xml);

Design Intent Specification dry.intent/1

High-level resolution-independent design layer schema for multi-process geometry definitions.

Motion Segment Specification dry.motion/1

Intermediate representation for kinematically resolved toolpath segments, coordinates, feedrates, and orientations.

Cutting Tool & Nozzle Specification dry.tool/1

Schema for endmills (flat, ballnose, chamfer), plasma torches, laser heads, and FDM extruder nozzles.

Machine Profile Specification dry.machine/1

Standardized JSON schema for describing manufacturing hardware constraints across 3D printers, CNC mills, laser cutters, and robotics:

{
  "$schema": "https://dry.yemelianov.dev/schema/dry.machine/1.json",
  "id": "bambu-x1-carbon",
  "name": "Bambu Lab X1-Carbon",
  "category": "3d_printer",
  "manufacturer": "Bambu Lab",
  "build_volume": {
    "x": [0, 256],
    "y": [0, 256],
    "z": [0, 256]
  },
  "max_feedrates": { "x": 500, "y": 500, "z": 30, "e": 60 },
  "max_acceleration": 20000,
  "firmware": "bambu",
  "kinematics": "corexy",
  "default_nozzle_diameter": 0.4,
  "max_hotend_temp": 300,
  "max_bed_temp": 120
}

Pre-Flight Verification Report dry.report/1

JSON schema for diagnostics, axis boundary checks, kinematic violations, collision flags, and manufacturing telemetry.