flash_slice
Slice STL, 3MF, or OBJ models into FlashForge-ready G-code with automatic orientation, support, and brim selection, returning a print summary.
Instructions
Slice an STL/3MF/OBJ with the installed Flash Studio CLI and return a print summary. Works for the whole bundled Flashforge line (AD5X, Adventurer 3/5M/A5, Creator 5 (Pro), Guider 2s/3 Ultra/4 (Pro), HF variants); defaults to the AD5X 0.4 nozzle (220x220x220, 4-spool IFS). Profiles are flattened (inherits merged), which fixes the silent 60 mm/s generic speeds the CLI otherwise falls back to. Geometry is analyzed to choose orientation, supports and brim; newer 3MF containers the CLI rejects are re-sliced from the extracted mesh. quality: fine (smallest layer), standard (closest to 0.20 mm), draft (largest). Models that do not fit are rejected unless allowOversize=true. Pass up to 4 names in filaments for multi-color jobs. Deliverable is a .gcode file.
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": {
"stl": "<stl>"
},
"name": "flash_slice"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| out | No | Output .gcode path, relative to the current directory. Defaults to <mesh name>.gcode | |
| stl | Yes | Mesh path (.stl/.3mf/.obj), relative to the current directory. | |
| brim | No | "auto" adds an outer brim for tall/narrow parts or tiny contact; "none"; "outer" = outer_only; "ears" without painted points behaves like a plain brim. | auto |
| raft | No | true = 3 raft layers, or an explicit layer count. For ABS/ASA warping. | |
| color | No | Filament colour for the G-code metadata: a name (orange, red, yellow, green, blue, cyan, purple, pink, black, white, grey, brown) or #RRGGBB. NOTE: the physical colour comes from the filament loaded in the IFS slot. | |
| infill | No | Sparse infill density percent, e.g. 15. Omit to keep the profile default. | |
| orient | No | "auto" (default): rotate only when it clearly removes overhangs or makes the model fit; true/"always": pass --orient; false: keep the mesh as-is. | auto |
| bedTemp | No | Override bed temperature (°C) for both first and later layers. | |
| bedType | No | Bed type for the CLI. Defaults to "High Temp Plate". | |
| brimGap | No | Gap between brim and model in mm; 0 = maximum adhesion. | |
| machine | No | Machine profile name, e.g. "AD5X 0.4 nozzle". Defaults to "Flashforge AD5X 0.4 nozzle" (220x220x220). | |
| quality | No | standard | |
| filament | No | Filament profile name (partial match allowed). AD5X variants are auto-picked for the nozzle. Defaults to PLA Basic, or the profile from `material`. | |
| material | No | Material preset: picks the AD5X filament profile and safe nozzle/bed temperatures (pla 215/60, petg 250/80, abs/asa 260/100, tpu 225/45). Overridden by explicit `filament`, `nozzleTemp`, `bedTemp`. | |
| supports | No | "auto" (default) enables tree supports only when the analyzed overhang is real; "none"; "tree"; "normal"; or a number = tree angle, e.g. 25. | auto |
| brimWidth | No | Brim width in mm (e.g. 10 for a wide adhesion skirt). | |
| filaments | No | Up to 4 filament names for a multi-color AD5X job (IFS). Overrides `filament`; needs a multi-part 3MF. | |
| fuzzySkin | No | Roughen the walls for a matte/boucle look. | none |
| nozzleTemp | No | Override nozzle temperature (°C) for both first and later layers — useful for non-brand filament. | |
| supportAngle | No | Overhang threshold in degrees from vertical (smaller = more supports). | |
| supportStyle | No | tree: organic|tree_slim|tree_hybrid; normal: grid|snug. Defaults to organic/grid. | |
| allowOversize | No | Slice even if the mesh exceeds the machine build volume (e.g. after scaling in the slicer). | |
| closeFanLayers | No | Keep the part cooling fan off for the first N layers. | |
| firstLayerSpeed | No | First layer speed in mm/s (slower = better adhesion). | |
| fuzzySkinThickness | No | ||
| supportBasePattern | No | Support base pattern: rectilinear|grid|honeycomb|lightning etc. | |
| supportTopZDistance | No | Gap between support and part, mm. Defaults to 0.26 for PETG, 0.18 for PLA. | |
| fuzzySkinPointDistance | No | ||
| supportBottomZDistance | No | ||
| supportInterfacePattern | No | auto|grid|rectilinear|concentric. | |
| supportInterfaceSpacing | No | ||
| supportObjectXyDistance | No | Horizontal clearance between support and model, mm (0.3-0.6). | |
| supportOnBuildPlateOnly | No | Only let supports start on the build plate (no support-on-model). | |
| supportBasePatternSpacing | No | ||
| supportInterfaceTopLayers | No | Dense interface layers under the overhang (2-3). | |
| supportInterfaceBottomLayers | No |