list_faces
Enumerate faces of solid bodies, returning centroid, type, and normal for spatial reasoning. Pass centroid to create_sketch_on_face for chained feature creation.
Instructions
Listar caras — enumerate faces of one or all solid bodies.
Mirror of list_edges for faces. Returns one dict per face with: - index: 0-based per-body. NOT durable across rebuilds. - body_name: which body the face belongs to. - type: "planar" | "cylindrical" | "conical" | "spherical" | "other". Informational; addressing is by centroid. - centroid_mm: [x, y, z] in mm — midpoint of the face's bounding box. DURABLE reference for create_sketch_on_face. - area_mm2: face area in mm² (None if SW didn't expose it). - normal: outward normal [nx, ny, nz] for planar faces; None if SW didn't expose it. OMITTED on non-planar faces (token economy — structurally N/A there). - radius_mm, axis, concave: for cylindrical faces only — the geometry-side bore Ø used by verify_build_report; concave True = bore wall, False = outer boss/step face, None = unknown. OMITTED on non-cylindrical faces. - box_mm: axis-aligned bounding box [xmin,ymin,zmin,xmax,ymax, zmax] in mm (None if SW didn't expose it) — lets verify_build_report derive through-vs-blind from geometry (a bore face spanning both ends of the body is a through cut, regardless of the feature-definition read).
Args: body_name: If given, return only faces of that body. Else return faces of every solid body in the active part.
Use case: chained-feature LLM workflow. The LLM lists faces, reasons spatially ("the top face has the largest +Z normal"), passes the centroid to create_sketch_on_face, then sketches and extrudes/cuts on it.
Caveat: per-body face ordering is determined by SW's internal topology and is NOT durable across rebuilds. Re-run list_faces immediately before create_sketch_on_face rather than caching centroids across model edits.
Example — find the top face of a 50x50x20 block (sketched on Front, extruded +Z by 20): faces = list_faces() top = max( (f for f in faces if f["normal"] and f["normal"][2] > 0.9), key=lambda f: f["centroid_mm"][2], ) # top["centroid_mm"] = [25.0, 25.0, 20.0]
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body_name | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |