engrave_text
Cuts or adds raised text on a planar face of a solid, useful for labeling mechanical parts and adding part numbers.
Instructions
Engrave (cut) or emboss (add) extruded text onto a planar face of a solid.
The text is rendered in a system TrueType font, extruded, laid flat on the chosen face centred on its centroid, then booleaned into the host solid.
handle: the host solid to mark. face: the planar face to put the text on — a stable f_* tag (preferred), a 'FaceN' index string, or an int. Must be a flat (planar) face. Get a tag from list_faces / query_faces. text: the string to render (non-empty). size: cap height of the text in mm (default 5.0). depth: extrusion/engraving depth in mm (default 0.5). Engrave recesses the text this far below the surface; emboss raises it this far above. mode: 'engrave' (default) cuts the text into the solid (removes material); 'emboss' fuses raised text onto the surface (adds material). position: optional [u, v] in-face offset in mm from the face centroid, along the text's local X (u) and Y (v) axes. Omit to centre on the face. font: optional absolute path to a .ttf/.ttc font file. If omitted, common macOS fonts are auto-probed (Arial, then Helvetica). If none is found and none is supplied, the call raises RuntimeError — pass an explicit path. name: label for the resulting solid (default 'Text').
Returns {handle, name, volume, text, mode, depth} where volume is the mm^3 of the resulting solid (less than the input for engrave, more for emboss). The host solid is consumed/hidden and replaced by the returned handle.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| face | Yes | ||
| font | No | ||
| mode | No | engrave | |
| name | No | Text | |
| size | No | ||
| text | Yes | ||
| depth | No | ||
| handle | Yes | ||
| position | No |