Appearance
TypeScript core types
Public TypeScript types and report contracts re-exported by the SDK.
Finding
Source: sdk/ts/src/ops.ts
docs/site/examples/verify.ts · python: docs/site/examples/verify.pyts
export interface FindingSingle verification finding, optionally tied to a resolved segment index.
Fields
| Field | Type | Required | Summary |
|---|---|---|---|
rule | string | Yes | Stable rule identifier, such as bounds or peak-acceleration. |
severity | Severity | Yes | Whether the finding blocks the contract or is advisory. |
segment | number | null | Yes | Zero-based segment index, or null when the finding is global. |
message | string | Yes | Human-readable finding details. |
MachineKinematics
Source: sdk/ts/src/engine.ts
ts
export interface MachineKinematicsMachine kinematic limits used by resolveBalancedIr and resolveVerify. Field names are snake_case to match the Rust serde serialization. All fields are optional; an unset field disables the corresponding check.
max_acceleration_mm_s2— peak centripetal acceleration ceiling (mm/s²).max_junction_velocity_mm_s— per-junction speed-change ceiling (mm/s).
Fields
| Field | Type | Required | Summary |
|---|---|---|---|
max_acceleration_mm_s2 | number | No | Declared in the public API. |
max_junction_velocity_mm_s | number | No | Declared in the public API. |
Metrics
Source: sdk/ts/src/ops.ts
ts
export interface MetricsSimulation metrics returned by simulate.
Fields
| Field | Type | Required | Summary |
|---|---|---|---|
total_time_s | number | Yes | Total estimated time in seconds. |
print_time_s | number | Yes | Estimated extruding move time in seconds. |
travel_time_s | number | Yes | Estimated travel move time in seconds. |
extruding_distance | number | Yes | Total extruding path length in mm. |
travel_distance | number | Yes | Total non-extruding path length in mm. |
extruded_volume | number | Yes | Deposited material volume in cubic mm. |
filament_length | number | Yes | Filament consumed in mm. |
segment_count | number | Yes | Number of resolved toolpath segments. |
max_flow_rate | number | Yes | Maximum observed flow rate in cubic mm/s. |
Op
Source: sdk/ts/src/ops.ts
ts
export type Op = | { op: 'geometry'; width: number; height: number }
| { op: 'extruder'; on: boolean }
| { op: 'speed'; print: number }
| { op: 'move'; x: number | null; y: number | null; z: number | null }
| {
op: 'arc';
cx: number;
cy: number;
x: number | null;
y: number | null;
z: number | null;
clockwise: boolean;
}
| { op: 'spline'; points: [number | null, number | null, number | null][] }
// process channels (§3): typed, defaulted, propagated by the engine.
| { op: 'temperature'; nozzle: number }
| { op: 'fan'; speed: number }
| { op: 'flow'; ratio: number }
| { op: 'tool'; index: number }
| { op: 'orient'; i: number; j: number; k: number }
| { op: 'dwell'; seconds: number }
| { op: 'manual_gcode'; text: string }
| { op: 'retract'; distance: number | null; speed: number | null }
| { op: 'unretract'; distance: number | null; speed: number | null }
| { op: 'deposit'; volume: number; speed: number }Authoring operation in Dry L1, before resolution into concrete toolpath segments.
PRINTERS
Source: sdk/ts/src/ops.ts
ts
export const PRINTERS: Record<string, ResolveParams>Device defaults (the generic printer). More profiles land with the device-profile work.
Report
Source: sdk/ts/src/ops.ts
docs/site/examples/verify.ts · python: docs/site/examples/verify.pyts
export interface ReportVerification result containing all findings emitted by enabled rules.
Fields
| Field | Type | Required | Summary |
|---|---|---|---|
findings | Finding[] | Yes | Declared in the public API. |
RESOLVE_PARAMS
Source: sdk/ts/src/ops.ts
ts
export const RESOLVE_PARAMS: ResolveParamsDefault resolver parameters for the generic built-in printer profile.
resolveBalancedIr
Source: sdk/ts/src/engine.ts
ts
export function resolveBalancedIr(ops: Op[], params: ResolveParams, kinematics?: MachineKinematics): ToolpathResolve a design through the kinematics-aware balanced optimization pipeline. When kinematics is provided its acceleration/junction-velocity limits shape the output (acceleration clamping + junction-velocity capping). Omitting kinematics falls back to the safe pipeline (same as resolveOptimizedIr).
Parameters
| Parameter | Type | Default | Required |
|---|---|---|---|
ops | Op[] | Yes | |
params | ResolveParams | Yes | |
kinematics | MachineKinematics | No |
Returns: Toolpath
resolveBinary
Source: sdk/ts/src/engine.ts
ts
export function resolveBinary(ops: Op[], params: ResolveParams): Uint8ArrayResolve a design and return the L2 Dry IR encoded as the binary DRY1 format (raw bytes).
Parameters
| Parameter | Type | Default | Required |
|---|---|---|---|
ops | Op[] | Yes | |
params | ResolveParams | Yes |
Returns: Uint8Array
resolveGcode
Source: sdk/ts/src/engine.ts
ts
export function resolveGcode(ops: Op[], params: ResolveParams, relativeE = true, travelG1E0 = false, fiveAxis = false, rotaryAxes = 'ab'): string[]Resolve a design and emit motion g-code. 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 MachineKinematics object used by resolveBalancedIr / resolveVerify.
Parameters
| Parameter | Type | Default | Required |
|---|---|---|---|
ops | Op[] | Yes | |
params | ResolveParams | Yes | |
relativeE | any | true | No |
travelG1E0 | any | false | No |
fiveAxis | any | false | No |
rotaryAxes | any | 'ab' | No |
Returns: string[]
resolveIr
Source: sdk/ts/src/engine.ts
ts
export function resolveIr(ops: Op[], params: ResolveParams): ToolpathResolve a design to the L2 Dry IR.
Parameters
| Parameter | Type | Default | Required |
|---|---|---|---|
ops | Op[] | Yes | |
params | ResolveParams | Yes |
Returns: Toolpath
resolveMetrics
Source: sdk/ts/src/engine.ts
ts
export function resolveMetrics(ops: Op[], params: ResolveParams): MetricsResolve a design and return its simulation metrics.
Parameters
| Parameter | Type | Default | Required |
|---|---|---|---|
ops | Op[] | Yes | |
params | ResolveParams | Yes |
Returns: Metrics
resolveMetricsIr
Source: sdk/ts/src/engine.ts
ts
export function resolveMetricsIr(irJson: string): MetricsSimulate an already-resolved Dry IR ({ version, segments }) and return its metrics. Unlike resolveMetrics, which simulates an L1 design, this takes a toolpath IR directly — so a caller can report the before/after time and peak flow of an optimized or balanced IR (which has no originating op-list). irJson is the JSON string of a Toolpath (e.g. the result of JSON.stringify on an optimizedIr/balancedIr toolpath).
Parameters
| Parameter | Type | Default | Required |
|---|---|---|---|
irJson | string | Yes |
Returns: Metrics
resolveOptimizedIr
Source: sdk/ts/src/engine.ts
ts
export function resolveOptimizedIr(ops: Op[], params: ResolveParams): ToolpathResolve a design through the standard L2 optimization pipeline.
Parameters
| Parameter | Type | Default | Required |
|---|---|---|---|
ops | Op[] | Yes | |
params | ResolveParams | Yes |
Returns: Toolpath
ResolveParams
Source: sdk/ts/src/ops.ts
ts
export interface ResolveParamsThe lowering defaults (print/travel feedrate, filament diameter) — mirrors the engine's ResolveParams.
Fields
| Field | Type | Required | Summary |
|---|---|---|---|
print_speed | number | Yes | Default extrusion feedrate in mm/min. |
travel_speed | number | Yes | Default travel feedrate in mm/min. |
dia | number | Yes | Filament diameter in mm. |
resolveVerify
Source: sdk/ts/src/engine.ts
ts
export function resolveVerify(ops: Op[], params: ResolveParams, maxFlow = 0, minTemp = 0, bounds?: Float64Array, monotonicZ = false, speedRange?: Float64Array, maxRetractionDistance = 0, maxRetractionSpeed = 0, maxTravelWithoutRetract = 0, firstLayerHeightRange?: Float64Array, firstLayerSpeedRange?: Float64Array, kinematics?: MachineKinematics): ReportResolve a design and verify it against safety contracts. The structured limits cross to the wasm engine as native typed values — bounds flat as [x0,x1,y0,y1,z0,z1] and each range as [min,max] (a Float64Array, or undefined to disable that check); the scalar ceilings use 0 to mean unset. The optional kinematics arg enables the peak-acceleration and junction-velocity verify rules.
Parameters
| Parameter | Type | Default | Required |
|---|---|---|---|
ops | Op[] | Yes | |
params | ResolveParams | Yes | |
maxFlow | any | 0 | No |
minTemp | any | 0 | No |
bounds | Float64Array | No | |
monotonicZ | any | false | No |
speedRange | Float64Array | No | |
maxRetractionDistance | any | 0 | No |
maxRetractionSpeed | any | 0 | No |
maxTravelWithoutRetract | any | 0 | No |
firstLayerHeightRange | Float64Array | No | |
firstLayerSpeedRange | Float64Array | No | |
kinematics | MachineKinematics | No |
Returns: Report
Segment
Source: sdk/ts/src/ops.ts
ts
export interface SegmentOne resolved motion or process segment in the Dry L2 IR.
Fields
| Field | Type | Required | Summary |
|---|---|---|---|
start | (number | null)[] | Yes | Declared in the public API. |
end | (number | null)[] | Yes | Declared in the public API. |
travel | boolean | Yes | Declared in the public API. |
speed | number | Yes | Declared in the public API. |
length | number | Yes | Declared in the public API. |
volume | number | Yes | Declared in the public API. |
filament | number | Yes | Declared in the public API. |
width | number | null | Yes | Declared in the public API. |
height | number | null | Yes | Declared in the public API. |
kind | SegmentKind | Yes | Declared in the public API. |
centre | [number, number] | null | Yes | Declared in the public API. |
clockwise | boolean | Yes | Declared in the public API. |
temperature | number | No | Declared in the public API. |
fan | number | No | Declared in the public API. |
flow | number | No | Declared in the public API. |
tool | number | No | Declared in the public API. |
dwell_s | number | No | Declared in the public API. |
manual_gcode | string | No | Declared in the public API. |
orientation | [number, number, number] | No | Declared in the public API. |
control_points | [number, number, number][] | No | Declared in the public API. |
SegmentKind
Source: sdk/ts/src/ops.ts
ts
export type SegmentKind = | 'line'
| 'arc'
| 'spline'
| 'dwell'
| 'retract'
| 'unretract'
| 'deposit'
| 'manual_gcode'One resolved L2 motion segment.
Severity
Source: sdk/ts/src/ops.ts
docs/site/examples/verify.ts · python: docs/site/examples/verify.pyts
export type Severity = 'error' | 'warning'Severity level for a verification finding.
Toolpath
Source: sdk/ts/src/ops.ts
ts
export interface ToolpathThe resolved L2 Dry IR.
Fields
| Field | Type | Required | Summary |
|---|---|---|---|
version | number | Yes | Declared in the public API. |
meta | ToolpathMeta | No | Declared in the public API. |
segments | Segment[] | Yes | Declared in the public API. |
ToolpathMeta
Source: sdk/ts/src/ops.ts
ts
export interface ToolpathMetaOptional provenance and invariant metadata attached to a resolved toolpath.
Fields
| Field | Type | Required | Summary |
|---|---|---|---|
generator | string | No | Name of the generator or pipeline that produced the toolpath. |
units | string | No | Coordinate and unit convention, normally millimeters. |
source_hash | string | No | Stable source hash when the toolpath was derived from an external artifact. |
invariants | string[] | No | Human-readable invariants the toolpath is expected to satisfy. |