slice_model
Convert 3D model files (STL, 3MF, STEP) to printable G-code using PrusaSlicer or OrcaSlicer. Automatically centers off-bed models to prevent printer crashes.
Instructions
Slice a 3D model (STL/3MF/STEP) to G-code using PrusaSlicer or OrcaSlicer.
Args:
input_path: Path to the input file (STL, 3MF, STEP, OBJ, AMF).
output_dir: Directory for the output G-code. Defaults to
the system temp directory.
profile: Path to a slicer profile/config file (.ini or .json).
printer_id: Optional printer model ID for bundled profile
auto-selection (e.g. ``"prusa_mini"``).
slicer_path: Explicit path to the slicer binary. Auto-detected
if omitted.
auto_center: When True (default), off-bed STLs are translated
to a bed-centered copy before slicing. This prevents the
class of crash where origin-centered meshes (common from
compose_part_from_primitives / OpenSCAD output) produce
sliced gcode with negative X/Y moves that drive the
nozzle into the printer frame. Set False only if you've
verified the input is already correctly positioned.
Returns a JSON object with the output G-code path. The output file
can then be uploaded to a printer with ``upload_file`` and printed
with ``start_print``.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| profile | No | ||
| input_path | Yes | ||
| output_dir | No | ||
| printer_id | No | ||
| auto_center | No | ||
| slicer_path | No |