Appearance
TypeScript Design API
Fluent authoring, lowering, simulation, verification, and G-code emission APIs.
Design
Source: sdk/ts/src/design.ts
ts
export class DesignFluent builder for Dry L1 authoring operations and engine-backed resolution calls.
Method summary
| Method | Signature | Sample | Summary |
|---|---|---|---|
geometry | geometry(width: number, height: number): this | Set the extrusion bead cross-section (mm). | |
extruder | extruder(on: boolean): this | Turn the extruder on/off (off => subsequent moves are travels). | |
speed | speed(printSpeed: number): this | Set the print feedrate (mm/min). | |
point | point(x: number | null = null, y: number | null = null, z: number | null = null): this | Move to a point; an omitted axis is inherited from the running position. | |
arc | arc(a: { cx: number; cy: number; x?: number | null; y?: number | null; z?: number | null; clockwise?: boolean }): this | A circular arc about (cx, cy) to an end point; clockwise => G2, else G3. | |
spline | spline(points: [number | null, number | null, number | null][]): this | A Catmull-Rom spline from the running position through each (x, y, z) control point. | |
temperature | temperature(nozzle: number): this | Set the nozzle temperature channel (°C). | |
fan | fan(speed: number): this | Set the part-cooling fan channel (0..1). | |
flow | flow(ratio: number): this | Set the flow multiplier channel (scales deposited volume; default 1.0). | |
tool | tool(index: number): this | Set the active tool channel. | |
orient | orient(i: number, j: number, k: number): this | Set the toolframe orientation: the tool-direction vector (i, j, k). Identity is +Z. | |
dwell | dwell(seconds: number): this | Pause in place for seconds (emits a G4 dwell). | |
manualGcode | manualGcode(text: string): this | Inject verbatim custom G-code. | |
retract | retract(distance: number | null = null, speed: number | null = null): this | Retract filament. | |
unretract | unretract(distance: number | null = null, speed: number | null = null): this | Prime filament back after a retraction. | |
deposit | deposit(volume: number, speed: number): this | Stationary extrusion of a set volume (mm³) at feedrate (mm/min). | |
gcode | gcode(printer = 'generic', relativeE = true, travelG1E0 = false, fiveAxis = false, rotaryAxes = 'ab'): string[] | Author a path | Resolve + emit motion g-code (an array of lines). rotaryAxes is the rotary-axes selector (the |
simulate | simulate(printer = 'generic'): Metrics | Simulate | Resolve + simulate; returns metrics (time, distances, material, peak flow). |
ir | ir(printer = 'generic'): Toolpath | Lower to the Dry IR | Resolve to the L2 Dry IR ({ version, segments }). |
optimizedIr | optimizedIr(printer = 'generic'): Toolpath | Optimize | Resolve through the standard L2 optimization pipeline. |
balancedIr | balancedIr(printer = 'generic', kinematics?: MachineKinematics): Toolpath | Optimize | Resolve through the kinematics-aware balanced optimization pipeline. When kinematics is |
binary | binary(printer = 'generic'): Uint8Array | Resolve + encode to the binary DRY1 format; returns the raw bytes. | |
verify | verify(printer = 'generic', maxFlow = 0, minTemp = 0, bounds: string | number[][] = '', monotonicZ = false, speedRange: string | [number, number] = '', maxRetractionDistance = 0, maxRetractionSpeed = 0, maxTravelWithoutRetract = 0, firstLayerHeightRange: string | [number, number] = '', firstLayerSpeedRange: string | [number, number] = '', kinematics?: MachineKinematics): Report | Verify | Resolve + verify against machine-safety contracts; returns the safety report findings. The |
geometry
ts
geometry(width: number, height: number): thisParameters
| Parameter | Type | Default | Required |
|---|---|---|---|
width | number | Yes | |
height | number | Yes |
Returns: this
Set the extrusion bead cross-section (mm).
extruder
ts
extruder(on: boolean): thisParameters
| Parameter | Type | Default | Required |
|---|---|---|---|
on | boolean | Yes |
Returns: this
Turn the extruder on/off (off => subsequent moves are travels).
speed
ts
speed(printSpeed: number): thisParameters
| Parameter | Type | Default | Required |
|---|---|---|---|
printSpeed | number | Yes |
Returns: this
Set the print feedrate (mm/min).
point
ts
point(x: number | null = null, y: number | null = null, z: number | null = null): thisParameters
| Parameter | Type | Default | Required |
|---|---|---|---|
x | number | null | null | No |
y | number | null | null | No |
z | number | null | null | No |
Returns: this
Move to a point; an omitted axis is inherited from the running position.
arc
ts
arc(a: { cx: number; cy: number; x?: number | null; y?: number | null; z?: number | null; clockwise?: boolean }): thisParameters
| Parameter | Type | Default | Required |
|---|---|---|---|
a | { cx: number; cy: number; x?: number | null; y?: number | null; z?: number | null; clockwise?: boolean } | Yes |
Returns: this
A circular arc about (cx, cy) to an end point; clockwise => G2, else G3.
spline
ts
spline(points: [number | null, number | null, number | null][]): thisParameters
| Parameter | Type | Default | Required |
|---|---|---|---|
points | [number | null, number | null, number | null][] | Yes |
Returns: this
A Catmull-Rom spline from the running position through each (x, y, z) control point.
temperature
ts
temperature(nozzle: number): thisParameters
| Parameter | Type | Default | Required |
|---|---|---|---|
nozzle | number | Yes |
Returns: this
Set the nozzle temperature channel (°C).
fan
ts
fan(speed: number): thisParameters
| Parameter | Type | Default | Required |
|---|---|---|---|
speed | number | Yes |
Returns: this
Set the part-cooling fan channel (0..1).
flow
ts
flow(ratio: number): thisParameters
| Parameter | Type | Default | Required |
|---|---|---|---|
ratio | number | Yes |
Returns: this
Set the flow multiplier channel (scales deposited volume; default 1.0).
tool
ts
tool(index: number): thisParameters
| Parameter | Type | Default | Required |
|---|---|---|---|
index | number | Yes |
Returns: this
Set the active tool channel.
orient
ts
orient(i: number, j: number, k: number): thisParameters
| Parameter | Type | Default | Required |
|---|---|---|---|
i | number | Yes | |
j | number | Yes | |
k | number | Yes |
Returns: this
Set the toolframe orientation: the tool-direction vector (i, j, k). Identity is +Z.
dwell
ts
dwell(seconds: number): thisParameters
| Parameter | Type | Default | Required |
|---|---|---|---|
seconds | number | Yes |
Returns: this
Pause in place for seconds (emits a G4 dwell).
manualGcode
ts
manualGcode(text: string): thisParameters
| Parameter | Type | Default | Required |
|---|---|---|---|
text | string | Yes |
Returns: this
Inject verbatim custom G-code.
retract
ts
retract(distance: number | null = null, speed: number | null = null): thisParameters
| Parameter | Type | Default | Required |
|---|---|---|---|
distance | number | null | null | No |
speed | number | null | null | No |
Returns: this
Retract filament.
unretract
ts
unretract(distance: number | null = null, speed: number | null = null): thisParameters
| Parameter | Type | Default | Required |
|---|---|---|---|
distance | number | null | null | No |
speed | number | null | null | No |
Returns: this
Prime filament back after a retraction.
deposit
ts
deposit(volume: number, speed: number): thisParameters
| Parameter | Type | Default | Required |
|---|---|---|---|
volume | number | Yes | |
speed | number | Yes |
Returns: this
Stationary extrusion of a set volume (mm³) at feedrate (mm/min).
gcode
docs/site/examples/author.ts · python: docs/site/examples/author.pyts
gcode(printer = 'generic', relativeE = true, travelG1E0 = false, fiveAxis = false, rotaryAxes = 'ab'): string[]Parameters
| Parameter | Type | Default | Required |
|---|---|---|---|
printer | any | 'generic' | No |
relativeE | any | true | No |
travelG1E0 | any | false | No |
fiveAxis | any | false | No |
rotaryAxes | any | 'ab' | No |
Returns: string[]
Resolve + emit motion g-code (an array of lines). rotaryAxes is the rotary-axes selector (the ab/ac/bc STRING) choosing which two rotary axes carry the toolframe orientation in 5-axis emit — distinct from the machine motion-limits kinematics object used by balancedIr / verify.
simulate
docs/site/examples/simulate.ts · python: docs/site/examples/simulate.pyts
simulate(printer = 'generic'): MetricsParameters
| Parameter | Type | Default | Required |
|---|---|---|---|
printer | any | 'generic' | No |
Returns: Metrics
Resolve + simulate; returns metrics (time, distances, material, peak flow).
ir
docs/site/examples/lower.ts · python: docs/site/examples/lower.pyts
ir(printer = 'generic'): ToolpathParameters
| Parameter | Type | Default | Required |
|---|---|---|---|
printer | any | 'generic' | No |
Returns: Toolpath
Resolve to the L2 Dry IR ({ version, segments }).
optimizedIr
docs/site/examples/optimize.ts · python: docs/site/examples/optimize.pyts
optimizedIr(printer = 'generic'): ToolpathParameters
| Parameter | Type | Default | Required |
|---|---|---|---|
printer | any | 'generic' | No |
Returns: Toolpath
Resolve through the standard L2 optimization pipeline.
balancedIr
docs/site/examples/optimize.ts · python: docs/site/examples/optimize.pyts
balancedIr(printer = 'generic', kinematics?: MachineKinematics): ToolpathParameters
| Parameter | Type | Default | Required |
|---|---|---|---|
printer | any | 'generic' | No |
kinematics | MachineKinematics | No |
Returns: Toolpath
Resolve through the kinematics-aware balanced optimization pipeline. When kinematics is provided its acceleration/junction-velocity limits shape the output (arc centripetal speed clamping + junction-velocity capping) on top of all standard optimizations. Omitting kinematics falls back to the safe pipeline (same as optimizedIr).
binary
ts
binary(printer = 'generic'): Uint8ArrayParameters
| Parameter | Type | Default | Required |
|---|---|---|---|
printer | any | 'generic' | No |
Returns: Uint8Array
Resolve + encode to the binary DRY1 format; returns the raw bytes.
verify
docs/site/examples/verify.ts · python: docs/site/examples/verify.pyts
verify(printer = 'generic', maxFlow = 0, minTemp = 0, bounds: string | number[][] = '', monotonicZ = false, speedRange: string | [number, number] = '', maxRetractionDistance = 0, maxRetractionSpeed = 0, maxTravelWithoutRetract = 0, firstLayerHeightRange: string | [number, number] = '', firstLayerSpeedRange: string | [number, number] = '', kinematics?: MachineKinematics): ReportParameters
| Parameter | Type | Default | Required |
|---|---|---|---|
printer | any | 'generic' | No |
maxFlow | any | 0 | No |
minTemp | any | 0 | No |
bounds | string | number[][] | '' | No |
monotonicZ | any | false | No |
speedRange | string | [number, number] | '' | No |
maxRetractionDistance | any | 0 | No |
maxRetractionSpeed | any | 0 | No |
maxTravelWithoutRetract | any | 0 | No |
firstLayerHeightRange | string | [number, number] | '' | No |
firstLayerSpeedRange | string | [number, number] | '' | No |
kinematics | MachineKinematics | No |
Returns: Report
Resolve + verify against machine-safety contracts; returns the safety report findings. The structured limits cross to the engine as native typed contracts (no CSV round-trip):
bounds— build volume as[[x0,x1],[y0,y1],[z0,z1]](mm). The legacy CSV string"x0,x1,y0,y1,z0,z1"is still accepted for backward compatibility.speedRange— extruding feedrate[min, max](mm/min); the legacy"min,max"CSV is accepted.maxFlow(mm³/s),minTemp(°C),monotonicZ(bool); 0 means unset for the scalar ceilings.maxRetractionDistance(mm),maxRetractionSpeed(mm/min),maxTravelWithoutRetract(mm) — retraction / stringing limits.firstLayerHeightRange,firstLayerSpeedRange— first-layer adhesion limits, each[min, max](or a"min,max"CSV string).kinematics— machine motion limits (max_acceleration_mm_s2and/ormax_junction_velocity_mm_s). When supplied, enables thepeak-accelerationandjunction-velocityverify rules; omitting it disables them.