auto_color_by_region
Split a 3D STL into color zones by geometric region—z-height bands, face normals, or random assignment—for multi-color printing, outputting separate STL files per color.
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.
: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.
: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 also 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.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| method | No | z_height | |
| input_path | Yes | ||
| num_colors | No | ||
| color_palette | No |