auto_color_by_region
Split a 3D model into printable color zones by geometric region, using Z-height bands, face normals, or random assignment, and export zone STLs plus a color-mapped 3MF.
Instructions
Split a 3D model into color zones by geometric region.
Supports multiple assignment methods:
- ``"z_height"``: horizontal bands by Z-height (default) —
faces crossing a band edge are cut exactly at it and the
cuts are capped, so the color boundary is a straight line
on any tessellation and each zone of a closed model is
itself a closed solid ready to slice
- ``"normal"``: group by face normal direction
(top / bottom / sides)
- ``"random"``: random face assignment for artistic prints
The 3MF takes whichever form actually prints: z_height bands
become one closed solid per color; normal/random colorings
follow the surface, so the mesh stays ONE watertight object
with the colors painted per triangle — slicers that support
color import (BambuStudio, OrcaSlicer) offer to map each
color to a filament on open.
Zero cloud dependencies — pure geometry.
Says whether its colours are on the printer, as
``colour_availability`` (absent when Kiln cannot see what is
loaded). Relay its ``say`` as written and add nothing about
filament: never suggest buying filament unless the person asks
for one or says yes to the offer in ``say``. On a yes, call
``find_closest_filaments`` with these colours and the print's
material.
:param input_path: Path to a binary STL file.
:param num_colors: Number of color zones (default 4).
:param method: Assignment method — ``"z_height"``,
``"normal"``, or ``"random"``.
:param color_palette: List of hex colors. Defaults to
white/red/black/grey.
:param material: Optional material the part will be printed in
(e.g. ``"PETG"``). A spool on record in a clearly
different material is then not named as one to load.
:param printer_id: Optional supported printer model id. Names
the bed the composed 3MF is placed on, so a model sitting
off the plate is centred on the machine's real bed rather
than an assumed 256mm one.
:returns: Dict with zone STL paths, hex colors, face counts,
AMS slot mapping, weight estimates, and optional 3MF path.INLINE 3D STAGE: on success this tool opens Kiln's interactive 3D stage — an inline viewer panel the user can orbit, zoom, and turn over — in hosts that render MCP Apps panels (Kiln's hosted connection attaches a browser stage link for hosts that don't). Oversized meshes are decimated automatically for the stage; the PNG preview is the floor, not the whole experience.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"input_path": "<input_path>"
},
"name": "auto_color_by_region"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| method | No | Assignment method — ``"z_height"``, ``"normal"``, or ``"random"``. Default: "z_height". | |
| material | No | Optional material the part will be printed in (e.g. ``"PETG"``). A spool on record in a clearly different material is then not named as one to load. Default: "". | |
| input_path | Yes | Path to a binary STL file. | |
| num_colors | No | Number of color zones (default 4). Default: 4. | |
| printer_id | No | Optional supported printer model id. Names the bed the composed 3MF is placed on, so a model sitting off the plate is centred on the machine's real bed rather than an assumed 256mm one. Default: "". | |
| color_palette | No | List of hex colors. Defaults to white/red/black/grey. |