Appearance
Python Design API
Generated from py/python/dry/__init__.py using Python AST extraction.
Design
An L1 design: a chain of authoring ops. Builders return self for fluent use.
Method summary
| Method | Signature | Sample | Summary |
|---|---|---|---|
geometry | def geometry(self, width: Number, height: Number) -> 'Design' | Set the extrusion bead cross-section (mm). | |
extruder | def extruder(self, on: bool) -> 'Design' | Turn the extruder on/off (off => subsequent moves are travels). | |
speed | def speed(self, print_speed: Number) -> 'Design' | Set the print feedrate (mm/min). | |
point | def point(self, x: Optional[Number] = None, y: Optional[Number] = None, z: Optional[Number] = None) -> 'Design' | Move to a point; an omitted axis is inherited from the running position. | |
arc | def arc(self, cx: Number, cy: Number, x: Optional[Number] = None, y: Optional[Number] = None, z: Optional[Number] = None, clockwise: bool = False) -> 'Design' | A circular arc about (cx, cy) to an end point; clockwise => G2, else G3. | |
spline | def spline(self, points: Sequence[Point]) -> 'Design' | A Catmull-Rom spline from the running position through each (x, y, z) control point. | |
temperature | def temperature(self, nozzle: Number) -> 'Design' | Set the nozzle temperature channel (°C). | |
fan | def fan(self, speed: Number) -> 'Design' | Set the part-cooling fan channel (0..1). | |
flow | def flow(self, ratio: Number) -> 'Design' | Set the flow multiplier channel (scales deposited volume; default 1.0). | |
tool | def tool(self, index: int) -> 'Design' | Set the active tool channel. | |
orient | def orient(self, i: Number, j: Number, k: Number) -> 'Design' | Set the toolframe orientation: the tool-direction vector (i, j, k). Identity is +Z. | |
dwell | def dwell(self, seconds: Number) -> 'Design' | Pause in place for seconds (emits a G4 dwell). | |
manual_gcode | def manual_gcode(self, text: str) -> 'Design' | Inject verbatim custom G-code. | |
deposit | def deposit(self, volume: Number, speed: Number) -> 'Design' | Stationary extrusion of a set volume (mm³) at feedrate (mm/min). | |
retract | def retract(self, distance: Optional[Number] = None, speed: Optional[Number] = None) -> 'Design' | Retract filament. | |
unretract | def unretract(self, distance: Optional[Number] = None, speed: Optional[Number] = None) -> 'Design' | Prime filament back after a retraction. | |
gcode | def gcode(self, printer: str = 'generic', relative_e: bool = True, travel_g1_e0: bool = False, five_axis: bool = False, rotary_axes: str = 'ab', kinematics: Optional[str] = None) -> List[str] | Author a path | Resolve + emit motion g-code (a list of lines). |
simulate | def simulate(self, printer: str = 'generic') -> Metrics | Simulate | Resolve + simulate; returns a metrics dict (time, distances, material, peak flow). |
ir | def ir(self, printer: str = 'generic') -> Toolpath | Lower to the Dry IR | Resolve to the L2 Dry IR; returns a dict ({version, segments}). |
optimized_ir | def optimized_ir(self, printer: str = 'generic') -> Toolpath | Optimize | Resolve + optimize; returns a dict ({version, segments}). |
balanced_ir | def balanced_ir(self, printer: str = 'generic', kinematics: Optional[Kinematics] = None) -> Toolpath | Optimize | Resolve + balanced (kinematics-aware) optimize; returns a dict ({version, segments}). |
binary | def binary(self, printer: str = 'generic') -> bytes | Resolve + encode to binary DRY1 format; returns a bytes object. | |
verify | def verify(self, printer: str = 'generic', max_flow: Optional[Number] = None, min_temp: Optional[Number] = None, bounds: Optional[Bounds] = None, monotonic_z: bool = False, speed_range: Optional[Range] = None, max_retraction_distance: Optional[Number] = None, max_retraction_speed: Optional[Number] = None, max_travel_without_retract: Optional[Number] = None, first_layer_height_range: Optional[Range] = None, first_layer_speed_range: Optional[Range] = None, kinematics: Optional[Kinematics] = None) -> Report | Verify | Resolve + verify against machine-safety contracts; returns a report dict with findings. |
geometry
py
def geometry(self, width: Number, height: Number) -> 'Design'Parameters
| Parameter | Annotation | Default | Required |
|---|---|---|---|
width | Number | Yes | |
height | Number | Yes |
Returns: 'Design'
Set the extrusion bead cross-section (mm).
extruder
py
def extruder(self, on: bool) -> 'Design'Parameters
| Parameter | Annotation | Default | Required |
|---|---|---|---|
on | bool | Yes |
Returns: 'Design'
Turn the extruder on/off (off => subsequent moves are travels).
speed
py
def speed(self, print_speed: Number) -> 'Design'Parameters
| Parameter | Annotation | Default | Required |
|---|---|---|---|
print_speed | Number | Yes |
Returns: 'Design'
Set the print feedrate (mm/min).
point
py
def point(self, x: Optional[Number] = None, y: Optional[Number] = None, z: Optional[Number] = None) -> 'Design'Parameters
| Parameter | Annotation | Default | Required |
|---|---|---|---|
x | Optional[Number] | None | No |
y | Optional[Number] | None | No |
z | Optional[Number] | None | No |
Returns: 'Design'
Move to a point; an omitted axis is inherited from the running position.
arc
py
def arc(self, cx: Number, cy: Number, x: Optional[Number] = None, y: Optional[Number] = None, z: Optional[Number] = None, clockwise: bool = False) -> 'Design'Parameters
| Parameter | Annotation | Default | Required |
|---|---|---|---|
cx | Number | Yes | |
cy | Number | Yes | |
x | Optional[Number] | None | No |
y | Optional[Number] | None | No |
z | Optional[Number] | None | No |
clockwise | bool | False | No |
Returns: 'Design'
A circular arc about (cx, cy) to an end point; clockwise => G2, else G3.
spline
py
def spline(self, points: Sequence[Point]) -> 'Design'Parameters
| Parameter | Annotation | Default | Required |
|---|---|---|---|
points | Sequence[Point] | Yes |
Returns: 'Design'
A Catmull-Rom spline from the running position through each (x, y, z) control point.
temperature
py
def temperature(self, nozzle: Number) -> 'Design'Parameters
| Parameter | Annotation | Default | Required |
|---|---|---|---|
nozzle | Number | Yes |
Returns: 'Design'
Set the nozzle temperature channel (°C).
fan
py
def fan(self, speed: Number) -> 'Design'Parameters
| Parameter | Annotation | Default | Required |
|---|---|---|---|
speed | Number | Yes |
Returns: 'Design'
Set the part-cooling fan channel (0..1).
flow
py
def flow(self, ratio: Number) -> 'Design'Parameters
| Parameter | Annotation | Default | Required |
|---|---|---|---|
ratio | Number | Yes |
Returns: 'Design'
Set the flow multiplier channel (scales deposited volume; default 1.0).
tool
py
def tool(self, index: int) -> 'Design'Parameters
| Parameter | Annotation | Default | Required |
|---|---|---|---|
index | int | Yes |
Returns: 'Design'
Set the active tool channel.
orient
py
def orient(self, i: Number, j: Number, k: Number) -> 'Design'Parameters
| Parameter | Annotation | Default | Required |
|---|---|---|---|
i | Number | Yes | |
j | Number | Yes | |
k | Number | Yes |
Returns: 'Design'
Set the toolframe orientation: the tool-direction vector (i, j, k). Identity is +Z.
dwell
py
def dwell(self, seconds: Number) -> 'Design'Parameters
| Parameter | Annotation | Default | Required |
|---|---|---|---|
seconds | Number | Yes |
Returns: 'Design'
Pause in place for seconds (emits a G4 dwell).
manual_gcode
py
def manual_gcode(self, text: str) -> 'Design'Parameters
| Parameter | Annotation | Default | Required |
|---|---|---|---|
text | str | Yes |
Returns: 'Design'
Inject verbatim custom G-code.
deposit
py
def deposit(self, volume: Number, speed: Number) -> 'Design'Parameters
| Parameter | Annotation | Default | Required |
|---|---|---|---|
volume | Number | Yes | |
speed | Number | Yes |
Returns: 'Design'
Stationary extrusion of a set volume (mm³) at feedrate (mm/min).
retract
py
def retract(self, distance: Optional[Number] = None, speed: Optional[Number] = None) -> 'Design'Parameters
| Parameter | Annotation | Default | Required |
|---|---|---|---|
distance | Optional[Number] | None | No |
speed | Optional[Number] | None | No |
Returns: 'Design'
Retract filament.
unretract
py
def unretract(self, distance: Optional[Number] = None, speed: Optional[Number] = None) -> 'Design'Parameters
| Parameter | Annotation | Default | Required |
|---|---|---|---|
distance | Optional[Number] | None | No |
speed | Optional[Number] | None | No |
Returns: 'Design'
Prime filament back after a retraction.
gcode
docs/site/examples/author.ts · python: docs/site/examples/author.pypy
def gcode(self, printer: str = 'generic', relative_e: bool = True, travel_g1_e0: bool = False, five_axis: bool = False, rotary_axes: str = 'ab', kinematics: Optional[str] = None) -> List[str]Parameters
| Parameter | Annotation | Default | Required |
|---|---|---|---|
printer | str | 'generic' | No |
relative_e | bool | True | No |
travel_g1_e0 | bool | False | No |
five_axis | bool | False | No |
rotary_axes | str | 'ab' | No |
kinematics | Optional[str] | None | No |
Returns: List[str]
Resolve + emit motion g-code (a list of lines).
rotary_axes is the rotary-axes selector — the ab/ac/bc STRING choosing which two rotary axes carry the toolframe orientation in 5-axis emit (five_axis=True). NOTE: this is NOT the machine motion-limits object (see balanced_ir / verify's kinematics for that). kinematics is a deprecated alias for rotary_axes, kept for backward compatibility; when provided (not None) it takes precedence.
simulate
docs/site/examples/simulate.ts · python: docs/site/examples/simulate.pypy
def simulate(self, printer: str = 'generic') -> MetricsParameters
| Parameter | Annotation | Default | Required |
|---|---|---|---|
printer | str | 'generic' | No |
Returns: Metrics
Resolve + simulate; returns a metrics dict (time, distances, material, peak flow).
ir
docs/site/examples/lower.ts · python: docs/site/examples/lower.pypy
def ir(self, printer: str = 'generic') -> ToolpathParameters
| Parameter | Annotation | Default | Required |
|---|---|---|---|
printer | str | 'generic' | No |
Returns: Toolpath
Resolve to the L2 Dry IR; returns a dict ({version, segments}).
optimized_ir
docs/site/examples/optimize.ts · python: docs/site/examples/optimize.pypy
def optimized_ir(self, printer: str = 'generic') -> ToolpathParameters
| Parameter | Annotation | Default | Required |
|---|---|---|---|
printer | str | 'generic' | No |
Returns: Toolpath
Resolve + optimize; returns a dict ({version, segments}).
balanced_ir
docs/site/examples/optimize.ts · python: docs/site/examples/optimize.pypy
def balanced_ir(self, printer: str = 'generic', kinematics: Optional[Kinematics] = None) -> ToolpathParameters
| Parameter | Annotation | Default | Required |
|---|---|---|---|
printer | str | 'generic' | No |
kinematics | Optional[Kinematics] | None | No |
Returns: Toolpath
Resolve + balanced (kinematics-aware) optimize; returns a dict ({version, segments}).
kinematics is a dict with optional keys max_acceleration_mm_s2 (mm/s²) and max_junction_velocity_mm_s (mm/s). When supplied, the engine applies arc centripetal speed clamping and junction-velocity capping in addition to the standard optimizations (balanced_pipeline). When None (default), falls back to safe_pipeline.
binary
py
def binary(self, printer: str = 'generic') -> bytesParameters
| Parameter | Annotation | Default | Required |
|---|---|---|---|
printer | str | 'generic' | No |
Returns: bytes
Resolve + encode to binary DRY1 format; returns a bytes object.
verify
docs/site/examples/verify.ts · python: docs/site/examples/verify.pypy
def verify(self, printer: str = 'generic', max_flow: Optional[Number] = None, min_temp: Optional[Number] = None, bounds: Optional[Bounds] = None, monotonic_z: bool = False, speed_range: Optional[Range] = None, max_retraction_distance: Optional[Number] = None, max_retraction_speed: Optional[Number] = None, max_travel_without_retract: Optional[Number] = None, first_layer_height_range: Optional[Range] = None, first_layer_speed_range: Optional[Range] = None, kinematics: Optional[Kinematics] = None) -> ReportParameters
| Parameter | Annotation | Default | Required |
|---|---|---|---|
printer | str | 'generic' | No |
max_flow | Optional[Number] | None | No |
min_temp | Optional[Number] | None | No |
bounds | Optional[Bounds] | None | No |
monotonic_z | bool | False | No |
speed_range | Optional[Range] | None | No |
max_retraction_distance | Optional[Number] | None | No |
max_retraction_speed | Optional[Number] | None | No |
max_travel_without_retract | Optional[Number] | None | No |
first_layer_height_range | Optional[Range] | None | No |
first_layer_speed_range | Optional[Range] | None | No |
kinematics | Optional[Kinematics] | None | No |
Returns: Report
Resolve + verify against machine-safety contracts; returns a report dict with findings.
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 and parsed here for backward compatibility.speed_range— extruding feedrate[min, max](mm/min); the legacy"min,max"CSV string is still accepted.max_flow(mm³/s),min_temp(°C),monotonic_z(bool).max_retraction_distance(mm),max_retraction_speed(mm/min),max_travel_without_retract(mm) — retraction / stringing limits.first_layer_height_range,first_layer_speed_range— first-layer adhesion limits, each[min, max](or a"min,max"CSV string).kinematics— dict with optionalmax_acceleration_mm_s2(mm/s²) and/ormax_junction_velocity_mm_s(mm/s). When supplied, enables thepeak-accelerationandjunction-velocityverify rules;Nonedisables them.