auto_arrange_parts_on_plate
Place multiple 3D print parts on a plate without overlap, grouping multi-color units at the same XY position for a single print job.
Instructions
Calculate non-overlapping XY positions for multiple parts on a print plate.
Use this **before** :func:`compose_multicolor_3mf` when you have multiple
separate objects (e.g., two coasters) to print in one job. Parts that
share the same ``group`` index are treated as a multi-color unit and
placed at the *same* XY position (they overlap intentionally).
Returns a list of positioned part specs ready to pass directly to
``compose_multicolor_3mf``.
Arrangement strategy (free tier): simple left-to-right row layout. For
maximum plate density (2D bin-packing), use kiln-pro.
Example -- two coasters, each with a body + QR layer::
positioned = auto_arrange_parts_on_plate(part_specs=[
{"stl_path": "/tmp/c1_body.stl", "extruder": 1, "group": 0, "material": "PLA Grey"},
{"stl_path": "/tmp/c1_qr.stl", "extruder": 2, "group": 0, "material": "PLA Black"},
{"stl_path": "/tmp/c2_body.stl", "extruder": 1, "group": 1, "material": "PLA Grey"},
{"stl_path": "/tmp/c2_qr.stl", "extruder": 2, "group": 1, "material": "PLA Black"},
], plate_width=256, plate_depth=256, gap_mm=5)
# -> each part now has "x", "y" set; pass to compose_multicolor_3mf
Args:
part_specs: List of dicts, each with:
* ``stl_path`` (str) -- absolute path to the STL
* ``extruder`` (int) -- 1-indexed AMS slot
* ``group`` (int, optional) -- parts sharing a group get the same
XY position (multi-color unit). Default: each part is its own group.
* ``name`` (str, optional) -- label in slicer
* ``color`` (str, optional) -- hex preview color
* ``material`` (str, optional) -- filament label (also triggers
compatibility checks when passed to compose_multicolor_3mf)
plate_width: Print plate X dimension in mm (default 256 for
legacy callers without a printer id).
plate_depth: Print plate Y dimension in mm (default 256 for
legacy callers without a printer id).
gap_mm: Minimum spacing between groups in mm.
printer_id: Optional supported printer model id. When
provided, printer intelligence supplies the plate size.
Returns:
Dict with ``success``, ``parts`` list (each part has ``x``, ``y`` set),
``group_count``, and ``message``.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| gap_mm | No | ||
| part_specs | Yes | ||
| printer_id | No | ||
| plate_depth | No | ||
| plate_width | No |