surface_trim
Trim surfaces with a cutting tool by removing chosen cells: inspect cell centers first, then pass one point per cell to delete, keeping points within max distance.
Instructions
Trim surfaces with a tool and remove the cells nearest to the given points.
Call surface_trim_cells first to see the cells (center / bbox / area in mm), then
pass a point per cell to remove (in units, default mm). Several points in one cell
remove it once. Cells are never addressed by index.
Errors: a point farther than max_distance from every cell -> INVALID_PARAMS with details.cells (the available cells) and nothing changed; a tool that cuts nothing -> INVALID_PARAMS reason "no_cells".
Returns {"feature", "health", "created_bodies" / "modified_bodies": [{ref, type, name, is_solid}], "removed_bodies", "removed_cells": n}.
Example: surface_trim(trim_tool="origin:XY", remove_points=[[0, 0, 20]])
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| units | No | Unit of plain-number lengths and points | mm |
| trim_tool | Yes | Cutting tool: surface body, face, construction plane / origin:XY|XZ|YZ or sketch curve | |
| max_distance | No | How far (in `units`) a point may be from its cell | |
| remove_points | Yes | Points [x, y, z] in `units`, each on or near a cell to remove (e.g. a cell center from surface_trim_cells) |