Files
OrcaSlicer/scripts/CAD/tool_atlas.json
T
SoftFever 15bb082ce2 Refuse misspelt Design arguments and tell agents how to fix refused calls
A misspelt argument to most Design commands was ignored, so the command ran with
its default, such as a helix built with the default pitch. Every Design command now
refuses it and names the arguments it takes. Refusals of a missing object or part,
an unknown setting key, an invalid setting value or a preset that is not installed
now say the valid range, the similar keys, what the setting takes or the command
to use, and plate_add and object_add_handy_model say what they added.
2026-11-22 01:28:26 +08:00

5001 lines
217 KiB
JSON

{
"_comment": [
"Source of truth for the Design tab's table: the object-driven tool offer, its Speed Dial actions and its",
"commands (see docs/HLSD/design-tab.md).",
"Every verb, the selections it accepts, the document state it needs, and its fixed",
"compass address. Extracted from the code, not from memory:",
" verbs + shortcuts + refusal messages -> src/slic3r/GUI/CAD/DesignPanel.cpp (feat_dropdown",
" call sites at 524/662/734/790/874/904, sk_key table at 369-400, m_keys_feature)",
" kernel coverage -> src/libslic3r/CAD/CadDocument.hpp (enum CadFeatureType)",
" Design commands -> a verb's `tool` block, and the entries with no slot (commands only):",
" the silent form's access, params and examples; McpToolsCad.cpp binds each block to its function",
" selection kinds -> src/slic3r/GUI/CAD/DesignCanvas.hpp (the on_*_selected callbacks)",
"gen_offer_table.py emits src/slic3r/GUI/CAD/DesignOffer.hpp from this file, so the map",
"exists once. Edit the atlas and regenerate; never hand-edit the header."
],
"slots": [
{
"id": "create",
"pos": "N",
"angle": 270,
"label": "Create",
"why": "makes new geometry from nothing you have yet"
},
{
"id": "add",
"pos": "NE",
"angle": 315,
"label": "Add material",
"why": "grows solid or sheet material"
},
{
"id": "remove",
"pos": "E",
"angle": 0,
"label": "Remove",
"why": "takes material away Shell lives here by decision of 2026-08-01, not by oversight."
},
{
"id": "dressup",
"pos": "SE",
"angle": 45,
"label": "Fillet / chamfer / draft",
"why": "finishes faces and edges without changing the shape's intent; named for the tools it holds, not for the trade word. RATIFIED 2026-08-01: Shell stays in Remove and Delete Face in Modify — this row is deliberately NOT the same set as the toolbar's dressup dropdown, which groups all five. Shell hollows a solid, so it belongs with the verbs that take material away. Do not re-open: a verb's row is its address and reordering breaks learned reach."
},
{
"id": "repeat",
"pos": "S",
"angle": 90,
"label": "Repeat",
"why": "copies what exists"
},
{
"id": "transform",
"pos": "SW",
"angle": 135,
"label": "Transform",
"why": "moves without changing shape"
},
{
"id": "reference",
"pos": "W",
"angle": 180,
"label": "Reference",
"why": "makes datums, curves and measurements"
},
{
"id": "modify",
"pos": "NW",
"angle": 225,
"label": "Modify",
"why": "edits or removes what is already there"
},
{
"id": "top",
"label": "Top",
"flat": true,
"why": "the verbs a selection is opened for most. A flat slot is not a family: its verbs sit first, at the top level of the offer, each an item of its own, and its label is never shown. Appended last, so no ratified index moved."
}
],
"selections": [
{
"id": "none",
"name": "Nothing selected",
"mode": "model",
"shape": "empty"
},
{
"id": "face_planar",
"name": "Planar face",
"mode": "model",
"shape": "box_top"
},
{
"id": "face_cyl",
"name": "Cylindrical face",
"mode": "model",
"shape": "box_bore"
},
{
"id": "face_other",
"name": "Curved face",
"mode": "model",
"shape": "box_fillet_face"
},
{
"id": "edge_str",
"name": "Straight edge",
"mode": "model",
"shape": "box_edge"
},
{
"id": "edge_circ",
"name": "Circular edge",
"mode": "model",
"shape": "box_bore_rim"
},
{
"id": "vertex",
"name": "Vertex",
"mode": "model",
"shape": "box_vertex"
},
{
"id": "body_solid",
"name": "Solid body",
"mode": "model",
"shape": "box_whole"
},
{
"id": "body_sheet",
"name": "Sheet body",
"mode": "model",
"shape": "sheet"
},
{
"id": "bodies_2",
"name": "Two bodies",
"mode": "model",
"shape": "two_boxes"
},
{
"id": "datum_plane",
"name": "Datum plane",
"mode": "model",
"shape": "datum"
},
{
"id": "datum_axis",
"name": "Datum axis",
"mode": "model",
"shape": "axis"
},
{
"id": "coordsys",
"name": "Coordinate system",
"mode": "model",
"shape": "csys"
},
{
"id": "art",
"name": "Text / imported art",
"mode": "model",
"shape": "art"
},
{
"id": "sk_loop",
"name": "Closed sketch loop",
"mode": "model",
"shape": "loop"
},
{
"id": "sk_none",
"name": "Sketch, nothing picked",
"mode": "sketch",
"shape": "sk_empty"
},
{
"id": "sk_line",
"name": "Sketch line",
"mode": "sketch",
"shape": "sk_line"
},
{
"id": "sk_arc",
"name": "Sketch arc or circle",
"mode": "sketch",
"shape": "sk_arc"
},
{
"id": "sk_point",
"name": "Sketch point",
"mode": "sketch",
"shape": "sk_point"
},
{
"id": "sk_2ent",
"name": "Two sketch entities",
"mode": "sketch",
"shape": "sk_two"
}
],
"doc_states": [
{
"id": "rich",
"name": "Working document",
"bodies": 2,
"sketches": 2,
"sheet": true,
"note": "two solids, two sketches, one sheet body — everything doc-gated is legal"
},
{
"id": "fresh",
"name": "Fresh document",
"bodies": 0,
"sketches": 0,
"sheet": false,
"note": "nothing built yet — shows how much of the ring is empty on first open"
}
],
"verbs": [
{
"id": "sketch_create",
"name": "Sketch",
"section": "Sketch",
"slot": "create",
"key": "Shift+S",
"feature": "Sketch",
"accepts": [
"face_planar",
"datum_plane",
"none"
],
"needs": {},
"refusal": "Select a flat face or a reference plane to sketch on",
"gui": true,
"action": "key:S+S",
"icon": "design_sketch",
"hint": "Sketch on the selected flat face or plane, or click one next",
"tool": {
"access": "sketch",
"ok_false": false,
"summary": "Open a sketch session on a plane, as picking a plane or face for Sketch does.",
"details": "Sketch points are [x, y] in that plane's frame (mm), from its origin: modeling_origin for a base plane. Reply: frame.",
"params": [
{"name": "plane", "type": "string|object", "default": "XY", "description": "\"XY\", \"XZ\" or \"YZ\" through modeling_origin; {\"datum\": i}, a Plane feature; or {\"body\": b, \"face\": f}, a planar face (origin at its centroid, normal out of the body, x from the world axes). The reply's frame gives the axes."}
],
"examples": [
{
"title": "A sketch on the XY plane",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}}
]
},
{
"title": "A sketch on a plate's top face",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "body_describe", "args": {"at_extreme": "+z", "body": 0}},
{"tool": "sketch_create", "args": {"generation": {"from_call": 1, "key": "generation"}, "plane": {"body": 0, "face": 5}}}
]
},
{
"title": "A sketch on a datum plane 20 mm above XY",
"calls": [
{"tool": "construct_plane", "args": {"base": "XY", "offset": 20, "type": "offset"}},
{"tool": "sketch_create", "args": {"plane": {"datum": 0}}}
]
}
],
"ids": true
}
},
{
"id": "extrude",
"name": "Extrude",
"section": "Solid",
"slot": "add",
"key": "Shift+E",
"feature": "Extrude",
"accepts": [
"sk_loop",
"face_planar"
],
"needs": {},
"refusal": "Create a sketch, or pick a solid face, first",
"gui": true,
"action": "key:S+E",
"icon": "design_extrude",
"hint": "Extrude a sketch profile, or push/pull a picked face",
"tool": {
"access": "change",
"ok_false": false,
"summary": "Extrude a committed sketch, one of its loops, a face or a drawn profile into a body.",
"details": "A committed sketch, or one loop of it, extrudes as the Extrude card does; push/pull grows a planar face of a body; a profile drawn here is an explicit closed `profile` (list of [x,y]) or a centred width x height rectangle on `plane`. End conditions match Onshape. Reply: extrude_index, the index of its sketch (-1 for a face), the operation and body used, end, frame.",
"params": [
{"name": "sketch", "type": "integer", "default": null, "description": "a committed Sketch feature to extrude (sketch_finish's sketch_index); profile, width, height and plane are then refused"},
{"name": "loop", "type": "integer", "default": null, "description": "with sketch: one closed loop (closed_loops[].index of sketch_describe {sketch}) with the loops inside it as holes; a hole is a loop of its own, so its index extrudes the disc. Omit for the whole sketch"},
{"name": "face", "type": "integer", "default": null, "description": "push/pull: a planar face (body_describe id) of `body` grown along its outward normal (flip for inward); operation auto joins that body. sketch, loop, profile, width, height, plane and taper are then refused, and end is blind or symmetric"},
{"name": "width", "type": "number", "unit": "mm", "default": 20},
{"name": "height", "type": "number", "unit": "mm", "default": 20},
{"name": "distance", "type": "number", "unit": "mm", "default": 10, "exclusive_min": 0},
{"name": "plane", "type": "string|object", "default": "XY", "description": "\"XY\", \"XZ\" or \"YZ\" through modeling_origin; {\"datum\": i}, a Plane feature; or {\"body\": b, \"face\": f}, a planar face (origin at its centroid, normal out of the body, x from the world axes). The reply's frame gives the axes."},
{"name": "profile", "type": "array", "default": [], "description": "optional closed contour [[x,y],...] in plane mm; overrides width/height"},
{"name": "operation", "type": "string", "default": null, "enum": ["auto", "new_body", "join", "cut", "intersect"], "description": "what the result does to the bodies: new_body makes a body of its own, join fuses it into `body`, cut removes it from `body`, intersect keeps their overlap; auto joins the body the profile touches, else makes a new body, as the card's default. Default auto with sketch or face, new_body without"},
{"name": "body", "type": "integer", "default": -1, "description": "the body to join, cut or intersect, or whose face is pushed; omit for the body a sketch touches, else the last body"},
{"name": "end", "type": "string", "default": "blind", "enum": ["blind", "symmetric", "two_sided", "through_all", "up_to_face"]},
{"name": "distance2", "type": "number", "unit": "mm", "default": 0, "description": "second-side depth when end=two_sided (else falls back to distance)"},
{"name": "up_to_face", "type": "integer", "default": -1, "description": "face id (body_describe) of the body the extrude works on, when end=up_to_face"},
{"name": "taper", "type": "number", "unit": "deg", "default": 0, "description": "draft/taper of the side wall"},
{"name": "flip", "type": "boolean", "default": false}
],
"examples": [
{
"title": "A 20 x 20 x 5 mm plate on the XY plane",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}}
]
},
{
"title": "A committed sketch extruded 5 mm: a rectangle around a circle makes a plate with a bore",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"p0": [-15, -10], "p1": [15, 10], "type": "rectangle_2_point"}},
{"tool": "sketch_draw", "args": {"entities": [{"center": [0, 0], "radius": 4, "type": "circle_center"}]}},
{"tool": "sketch_finish", "args": {}},
{"tool": "extrude", "args": {"distance": 5, "sketch": 0}}
]
},
{
"title": "A plate's top face pushed up 3 mm",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "body_describe", "args": {"at_extreme": "+z", "body": 0}},
{"tool": "extrude", "args": {"body": 0, "distance": 3, "face": 5, "generation": {"from_call": 1, "key": "generation"}}}
]
}
],
"ids": true
}
},
{
"id": "revolve",
"name": "Revolve",
"section": "Solid",
"slot": "add",
"key": "Shift+R",
"feature": "Revolve",
"accepts": [
"sk_loop"
],
"needs": {},
"refusal": "Create a sketch profile to revolve first",
"gui": true,
"action": "key:S+R",
"icon": "design_revolve",
"hint": "Revolve a profile about an axis",
"tool": {
"access": "change",
"ok_false": false,
"summary": "Revolve a committed sketch as the Revolve card does, or a profile drawn here, about an axis.",
"details": "A sketch turns about a line of it or a plane axis; a profile drawn here is an explicit `profile` offset from the axis, or a width x height rectangle with one edge on the axis, centred along it, so a full turn is a cylinder width long of radius height. Reply: revolve_index, the index of its sketch, the operation, body and axis used, frame.",
"params": [
{"name": "sketch", "type": "integer", "default": null, "description": "a committed Sketch feature to revolve (sketch_finish's sketch_index); profile, width, height and plane are then refused"},
{"name": "axis_entity", "type": "integer", "default": null, "description": "with sketch: a line of the sketch (entity index) as the axis, or -1 for the plane axis; omit for the sketch's only centerline (construction line) when it has one and axis is not given"},
{"name": "width", "type": "number", "unit": "mm", "default": 20, "description": "without sketch or profile: the rectangle's length along the axis"},
{"name": "height", "type": "number", "unit": "mm", "default": 10, "description": "without sketch or profile: how far the rectangle reaches out from the axis, the solid's radius"},
{"name": "angle", "type": "number", "unit": "deg", "default": 360},
{"name": "axis", "type": "integer", "default": 0, "enum": [0, 1], "description": "the plane's X (0) or Y (1) axis through its origin"},
{"name": "flip", "type": "boolean", "default": false},
{"name": "plane", "type": "string|object", "default": "XY", "description": "\"XY\", \"XZ\" or \"YZ\" through modeling_origin; {\"datum\": i}, a Plane feature; or {\"body\": b, \"face\": f}, a planar face (origin at its centroid, normal out of the body, x from the world axes). The reply's frame gives the axes."},
{"name": "profile", "type": "array", "default": [], "description": "optional closed contour [[x,y],...] in plane mm; overrides width/height"},
{"name": "operation", "type": "string", "default": "new_body", "enum": ["new_body", "join", "cut", "intersect"], "description": "what the result does to the bodies: new_body makes a body of its own, join fuses it into `body`, cut removes it from `body`, intersect keeps their overlap"},
{"name": "body", "type": "integer", "default": -1, "description": "the body to join, cut or intersect; omit for the last body"}
],
"examples": [
{
"title": "A ring: a profile 10 to 15 mm out from the XZ plane's vertical axis, turned a full circle",
"calls": [
{"tool": "revolve", "args": {"axis": 1, "plane": "XZ", "profile": [[10, 0], [15, 0], [15, 10], [10, 10]]}}
]
},
{
"title": "A committed sketch turned about its centerline, a construction line",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XZ"}},
{"tool": "sketch_draw", "args": {"p0": [10, 0], "p1": [15, 10], "type": "rectangle_2_point"}},
{"tool": "sketch_draw", "args": {"entities": [{"construction": true, "p0": [0, 0], "p1": [0, 10], "type": "line"}]}},
{"tool": "sketch_finish", "args": {}},
{"tool": "revolve", "args": {"sketch": 0}}
]
}
],
"ids": true
}
},
{
"id": "sweep",
"name": "Sweep",
"section": "Solid",
"slot": "add",
"key": "Shift+W",
"feature": "Sweep",
"accepts": [
"sk_loop"
],
"needs": {
"sketches": 2
},
"refusal": "Create a profile sketch to sweep first",
"gui": true,
"action": "key:S+W",
"icon": "design_sweep",
"hint": "Sweep a profile along a path",
"tool": {
"access": "change",
"ok_false": false,
"summary": "Sweep a committed sketch's closed profile along a path, a sketch or a helix, as the Sweep card does.",
"details": "Draw the profile across the path's start (a helix's start and tangent are in its reply); along a helix the profile keeps its angle to the helix axis. Long sweeps take seconds and the reply may be a job. Reply: sweep_index, bodies, operation, body.",
"params": [
{"name": "sketch", "type": "integer", "description": "the profile: a committed sketch's feature index"},
{"name": "path", "type": "integer", "description": "feature index of a sketch or a helix, other than the profile"},
{"name": "operation", "type": "string", "default": "new_body", "enum": ["new_body", "join", "cut", "intersect"], "description": "what the result does to the bodies: new_body makes a body of its own, join fuses it into `body`, cut removes it from `body`, intersect keeps their overlap"},
{"name": "body", "type": "integer", "default": -1, "description": "the body a join, cut or intersect works on; omit for the last body"}
],
"examples": [
{
"title": "A spring: a 2 mm circle across a helix's start, swept along it",
"calls": [
{"tool": "helix", "args": {"height": 20, "pitch": 5, "radius": 10}},
{"tool": "sketch_create", "args": {"plane": "XZ"}},
{"tool": "sketch_draw", "args": {"entities": [{"center": [10, 0], "radius": 1, "type": "circle_center"}]}},
{"tool": "sketch_finish", "args": {}},
{"tool": "sweep", "args": {"path": 0, "sketch": 1}}
]
},
{
"title": "A 6 mm rod swept along a 40 mm line",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"entities": [{"p0": [0, 0], "p1": [0, 40], "type": "line"}]}},
{"tool": "sketch_finish", "args": {}},
{"tool": "sketch_create", "args": {"plane": "XZ"}},
{"tool": "sketch_draw", "args": {"entities": [{"center": [0, 0], "radius": 3, "type": "circle_center"}]}},
{"tool": "sketch_finish", "args": {}},
{"tool": "sweep", "args": {"path": 0, "sketch": 1}}
]
}
],
"ids": false
}
},
{
"id": "loft",
"name": "Loft",
"section": "Solid",
"slot": "add",
"key": "Shift+L",
"feature": "Loft",
"accepts": [
"sk_loop"
],
"needs": {
"sketches": 2
},
"refusal": "Create at least two profile sketches to loft",
"gui": true,
"action": "key:S+L",
"icon": "design_loft",
"hint": "Loft (skin) between two or more profiles",
"tool": {
"access": "change",
"ok_false": false,
"summary": "Loft a solid through two or more committed sketches, in order, as the Loft card does.",
"details": "Each sketch is on its own plane (sketch on datum planes). Lofts take seconds and the reply may be a job. Reply: loft_index, bodies, operation, body.",
"params": [
{"name": "profiles", "type": "array", "description": "sketch feature indices, in loft order"},
{"name": "ruled", "type": "boolean", "default": false, "description": "straight sections between the profiles instead of a smooth skin"},
{"name": "operation", "type": "string", "default": "new_body", "enum": ["new_body", "join", "cut", "intersect"], "description": "what the result does to the bodies: new_body makes a body of its own, join fuses it into `body`, cut removes it from `body`, intersect keeps their overlap"},
{"name": "body", "type": "integer", "default": -1, "description": "the body a join, cut or intersect works on; omit for the last body"}
],
"examples": [
{
"title": "A square-to-round transition 20 mm tall, the circle sketched on a datum plane",
"calls": [
{"tool": "construct_plane", "args": {"base": "XY", "offset": 20, "type": "offset"}},
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"p0": [-10, -10], "p1": [10, 10], "type": "rectangle_2_point"}},
{"tool": "sketch_finish", "args": {}},
{"tool": "sketch_create", "args": {"plane": {"datum": 0}}},
{"tool": "sketch_draw", "args": {"entities": [{"center": [0, 0], "radius": 6, "type": "circle_center"}]}},
{"tool": "sketch_finish", "args": {}},
{"tool": "loft", "args": {"profiles": [1, 2]}}
]
}
],
"ids": false
}
},
{
"id": "thicken",
"name": "Thicken",
"section": "Solid",
"slot": "add",
"key": null,
"feature": "Thicken",
"accepts": [
"face_planar",
"face_other"
],
"needs": {
"bodies": 1
},
"refusal": "Thicken needs a solid body — add or import one first",
"gui": true,
"action": "fly:material#4",
"icon": "design_thicken",
"hint": "Offset a solid face into a thin plate (new body)",
"args": {"type": "face"},
"tool": {
"access": "change",
"ok_false": false,
"summary": "Thicken a face of a body, or a whole sheet body, into a new solid body by a wall thickness.",
"details": "type face offsets one face of a body into a thin plate. type surface thickens a sheet body: a sheet of several faces whose free rims close into planar loops (the walls of a box with no lids) is capped at them and grows inward, into the closed shape that makes, whatever flip says; one whose rim can't be capped is refused. A single face or a closed shell is offset face by face along each face's normal, the one body_describe gives, or against it with flip; a closed shell can fail to thicken this way. Reply: thicken_index, bodies.",
"params": [
{"name": "type", "type": "string", "default": null, "enum": ["face", "surface"], "description": "face thickens `face` of the body; surface thickens the whole sheet body. Left out: face when `face` is given, else surface"},
{"name": "body", "type": "integer", "default": -1, "description": "the body, a sheet body for type surface; omit for the last body"},
{"name": "face", "type": "integer", "default": null, "description": "with type face: the face id to thicken (body_describe); refused with type surface"},
{"name": "thickness", "type": "number", "unit": "mm", "default": 2},
{"name": "flip", "type": "boolean", "default": false}
],
"examples": [
{
"title": "A 2 mm skin grown from a plate's top face as a new body",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "body_describe", "args": {"at_extreme": "+z", "body": 0}},
{"tool": "thicken", "args": {"body": 0, "face": 5, "generation": {"from_call": 1, "key": "generation"}, "thickness": 2}}
]
},
{
"title": "A 30 x 20 mm sheet thickened into a 2 mm plate, a new body",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"p0": [-15, -10], "p1": [15, 10], "type": "rectangle_2_point"}},
{"tool": "sketch_finish", "args": {}},
{"tool": "surface_patch", "args": {"sketch": 0}},
{"tool": "thicken", "args": {"thickness": 2, "type": "surface"}}
]
},
{
"title": "An open tube thickened 1.5 mm outward into a pipe: flip, as its normal points inward",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"entities": [{"center": [0, 0], "radius": 10, "type": "circle_center"}]}},
{"tool": "sketch_finish", "args": {}},
{"tool": "surface_extrude", "args": {"distance": 20, "sketch": 0}},
{"tool": "thicken", "args": {"body": 0, "flip": true, "thickness": 1.5, "type": "surface"}}
]
}
],
"ids": true
}
},
{
"id": "rib",
"name": "Rib",
"section": "Solid",
"slot": "add",
"key": "R",
"feature": "Rib",
"accepts": [
"sk_line"
],
"needs": {
"bodies": 1
},
"refusal": "Rib needs a solid body — add or import one first",
"gui": true,
"action": "fly:material#5",
"icon": "design_rib",
"hint": "Grow a thin wall from an open sketch line, fused to a body",
"tool": {
"access": "change",
"ok_false": true,
"summary": "Grow a thin rib wall (stiffener) from an open Line sketch entity, fused to a body.",
"details": "The wall is centred on the line in the sketch plane, thickness wide, and grows depth along the sketch plane's normal.",
"params": [
{"name": "sketch", "type": "integer", "description": "sketch feature index holding the open line"},
{"name": "entity", "type": "integer", "description": "entity index of the open Line within the sketch"},
{"name": "thickness", "type": "number", "unit": "mm", "default": 2},
{"name": "depth", "type": "number", "unit": "mm", "default": 10, "description": "along the sketch plane's normal, or against it when negative"},
{"name": "body", "type": "integer", "default": -1, "description": "target body; omit for the last body"}
],
"examples": [
{
"title": "A 2 mm rib 8 mm tall across a plate's top face",
"calls": [
{"tool": "extrude", "args": {"distance": 3, "height": 20, "width": 40}},
{"tool": "body_describe", "args": {"at_extreme": "+z", "body": 0}},
{"tool": "sketch_create", "args": {"generation": {"from_call": 1, "key": "generation"}, "plane": {"body": 0, "face": 5}}},
{"tool": "sketch_draw", "args": {"entities": [{"p0": [-15, 0], "p1": [15, 0], "type": "line"}]}},
{"tool": "sketch_finish", "args": {}},
{"tool": "rib", "args": {"depth": 8, "entity": 0, "sketch": 2, "thickness": 2}}
]
}
],
"ids": false
}
},
{
"id": "boolean",
"name": "Join",
"section": "Solid",
"slot": "add",
"key": "Shift+B",
"feature": "Boolean",
"accepts": [
"bodies_2"
],
"needs": {
"bodies": 2
},
"refusal": "Boolean needs two bodies — add or import a second one",
"gui": true,
"action": "btn:bool#0",
"icon": "design_boolean",
"hint": "Fuse the tool body into the target — one solid, no seam",
"args": {"operation": "join"},
"tool": {
"access": "change",
"ok_false": true,
"summary": "Combine two bodies: join them, cut the tool from the target, or keep where they intersect.",
"details": "",
"params": [
{"name": "operation", "type": "string", "enum": ["join", "cut", "intersect"], "description": "join fuses the tool into the target; cut removes the tool from the target; intersect keeps only where the two overlap"},
{"name": "target", "type": "integer", "default": 0},
{"name": "tool", "type": "integer", "default": 1},
{"name": "keep_tool", "type": "boolean", "default": false},
{"name": "tolerance", "type": "number", "unit": "mm", "default": 0}
],
"examples": [
{
"title": "A post cut from a block",
"calls": [
{"tool": "extrude", "args": {"distance": 10, "height": 20, "width": 20}},
{"tool": "extrude", "args": {"distance": 20, "height": 6, "operation": "new_body", "width": 6}},
{"tool": "boolean", "args": {"operation": "cut", "target": 0, "tool": 1}}
]
},
{
"title": "Two overlapping blocks joined into one body",
"calls": [
{"tool": "extrude", "args": {"distance": 10, "height": 20, "width": 20}},
{"tool": "extrude", "args": {"distance": 10, "operation": "new_body", "profile": [[5, -5], [20, -5], [20, 5], [5, 5]]}},
{"tool": "boolean", "args": {"operation": "join", "target": 0, "tool": 1}}
]
}
],
"ids": false
}
},
{
"id": "bool_subtract",
"name": "Subtract",
"slot": "add",
"key": null,
"feature": "Boolean",
"accepts": [
"bodies_2"
],
"needs": {
"bodies": 2
},
"refusal": "Boolean needs two bodies — add or import a second one",
"gui": true,
"action": "btn:bool#1",
"mode": null,
"icon": "design_boolean",
"hint": "Cut the tool body out of the target",
"fold": {"into": "boolean", "args": {"operation": "cut"}}
},
{
"id": "bool_intersect",
"name": "Intersect",
"slot": "add",
"key": null,
"feature": "Boolean",
"accepts": [
"bodies_2"
],
"needs": {
"bodies": 2
},
"refusal": "Boolean needs two bodies — add or import a second one",
"gui": true,
"action": "btn:bool#2",
"mode": null,
"icon": "design_boolean",
"hint": "Keep only where the two bodies overlap",
"fold": {"into": "boolean", "args": {"operation": "intersect"}}
},
{
"id": "surface_extrude",
"name": "Surface Extrude",
"section": "Surface",
"slot": "add",
"key": "Shift+G",
"feature": "SurfaceExtrude",
"accepts": [
"sk_loop"
],
"needs": {},
"refusal": "Create a sketch first",
"gui": true,
"action": "key:S+G",
"icon": "design_extrude",
"hint": "Extrude a sketch into a sheet body (no end caps)",
"tool": {
"access": "change",
"ok_false": true,
"summary": "Extrude a sketch wire with no end caps -> an open sheet body.",
"details": "",
"params": [
{"name": "sketch", "type": "integer", "description": "sketch feature index"},
{"name": "distance", "type": "number", "unit": "mm", "default": 10, "description": "along the sketch plane's normal, or against it when negative"}
],
"examples": [
{
"title": "A 30 mm line extruded 10 mm into a flat sheet",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"entities": [{"p0": [-15, 0], "p1": [15, 0], "type": "line"}]}},
{"tool": "sketch_finish", "args": {}},
{"tool": "surface_extrude", "args": {"distance": 10, "sketch": 0}}
]
},
{
"title": "A circle extruded 20 mm into an open tube, with no end caps",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"entities": [{"center": [0, 0], "radius": 10, "type": "circle_center"}]}},
{"tool": "sketch_finish", "args": {}},
{"tool": "surface_extrude", "args": {"distance": 20, "sketch": 0}}
]
}
],
"ids": false
}
},
{
"id": "surface_revolve",
"name": "Surface Revolve",
"section": "Surface",
"slot": "add",
"key": null,
"feature": "SurfaceRevolve",
"accepts": [
"sk_loop"
],
"needs": {},
"refusal": "Create a sketch profile to revolve first",
"gui": true,
"action": "fly:surface#1",
"icon": "design_revolve",
"hint": "Revolve a sketch profile into a sheet body",
"tool": {
"access": "change",
"ok_false": true,
"summary": "Revolve a sketch wire with no caps -> an open sheet body.",
"details": "The axis is chosen as revolve chooses it: axis_entity, else the sketch's only centerline when axis is not given, else the plane axis.",
"params": [
{"name": "sketch", "type": "integer", "description": "sketch feature index"},
{"name": "angle", "type": "number", "unit": "deg", "default": 360},
{"name": "axis", "type": "integer", "default": 0, "enum": [0, 1], "description": "the sketch plane's X (0) or Y (1) axis through its origin"},
{"name": "axis_entity", "type": "integer", "default": null, "description": "a line of the sketch (entity index) as the axis, or -1 for the plane axis; omit for the sketch's only centerline (construction line) when it has one and axis is not given"},
{"name": "flip", "type": "boolean", "default": false, "description": "turn the other way about the axis"}
],
"examples": [
{
"title": "A cylinder's wall: a line 10 mm out from the XZ plane's vertical axis, turned a full circle",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XZ"}},
{"tool": "sketch_draw", "args": {"entities": [{"p0": [10, 0], "p1": [10, 20], "type": "line"}]}},
{"tool": "sketch_finish", "args": {}},
{"tool": "surface_revolve", "args": {"axis": 1, "sketch": 0}}
]
},
{
"title": "Half a truncated cone's wall: a sloping line turned 180 degrees about the XZ plane's vertical axis",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XZ"}},
{"tool": "sketch_draw", "args": {"entities": [{"p0": [5, 0], "p1": [15, 20], "type": "line"}]}},
{"tool": "sketch_finish", "args": {}},
{"tool": "surface_revolve", "args": {"angle": 180, "axis": 1, "sketch": 0}}
]
}
],
"ids": false
}
},
{
"id": "surface_loft",
"name": "Surface Loft",
"section": "Surface",
"slot": "add",
"key": null,
"feature": "SurfaceLoft",
"accepts": [
"sk_loop"
],
"needs": {
"sketches": 2
},
"refusal": "Create at least two profile sketches to loft",
"gui": true,
"action": "fly:surface#2",
"icon": "design_loft",
"hint": "Loft (skin) between 2+ profiles, open (no end caps)",
"tool": {
"access": "change",
"ok_false": true,
"summary": "Skin two or more profile sketches with no end caps -> an open sheet body.",
"details": "",
"params": [
{"name": "profiles", "type": "array", "description": "sketch feature indices, in order"},
{"name": "ruled", "type": "boolean", "default": false}
],
"examples": [
{
"title": "An open funnel skinned from a circle on XY to a wider one on a datum plane 20 mm up",
"calls": [
{"tool": "construct_plane", "args": {"base": "XY", "offset": 20, "type": "offset"}},
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"entities": [{"center": [0, 0], "radius": 5, "type": "circle_center"}]}},
{"tool": "sketch_finish", "args": {}},
{"tool": "sketch_create", "args": {"plane": {"datum": 0}}},
{"tool": "sketch_draw", "args": {"entities": [{"center": [0, 0], "radius": 15, "type": "circle_center"}]}},
{"tool": "sketch_finish", "args": {}},
{"tool": "surface_loft", "args": {"profiles": [1, 2]}}
]
}
],
"ids": false
}
},
{
"id": "surface_patch",
"name": "Surface Fill",
"section": "Surface",
"slot": "add",
"key": null,
"feature": "SurfaceFill",
"accepts": [
"sk_loop"
],
"needs": {},
"refusal": "Create a closed sketch first",
"gui": true,
"action": "fly:surface#3",
"icon": "design_surface",
"hint": "Fill a sketch boundary with a smooth face",
"tool": {
"access": "change",
"ok_false": true,
"summary": "Fill a sketch's closed boundary with one smooth face -> a sheet body.",
"details": "",
"params": [
{"name": "sketch", "type": "integer", "description": "sketch feature index"}
],
"examples": [
{
"title": "A circle filled with a disc-shaped sheet",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"entities": [{"center": [0, 0], "radius": 10, "type": "circle_center"}]}},
{"tool": "sketch_finish", "args": {}},
{"tool": "surface_patch", "args": {"sketch": 0}}
]
},
{
"title": "A rectangle filled with a flat sheet",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"p0": [-15, -10], "p1": [15, 10], "type": "rectangle_2_point"}},
{"tool": "sketch_finish", "args": {}},
{"tool": "surface_patch", "args": {"sketch": 0}}
]
}
],
"ids": false
}
},
{
"id": "thicken_surf",
"name": "Thicken Surface",
"slot": "add",
"key": null,
"feature": "ThickenSurface",
"accepts": [
"body_sheet"
],
"needs": {
"sheet": true
},
"refusal": "Thicken Surface needs a surface body — make one with a Surface tool first",
"gui": true,
"action": "fly:surface#5",
"icon": "design_thicken",
"hint": "Thicken a sheet body into a solid",
"fold": {"into": "thicken", "args": {"type": "surface"}}
},
{
"id": "hole",
"name": "Hole",
"section": "Solid",
"slot": "remove",
"key": "Shift+H",
"feature": "Hole",
"accepts": [
"face_planar",
"datum_plane"
],
"needs": {
"bodies": 1
},
"refusal": "Pick a face or a plane to drill into",
"gui": true,
"action": "key:S+H",
"icon": "design_hole",
"hint": "Drill a hole, centered on a picked face or placed on a plane",
"tool": {
"access": "change",
"ok_false": false,
"summary": "Drill a hole, simple, counterbored or countersunk, at (x,y) or `at` on a plane.",
"details": "type counterbore or countersink seats a screw head: a counterbore sized by cbore_*, a countersink by csink_*, each refused with another type. designation drills a standard clearance hole (ISO 273 / ANSI) and sizes its seat to the standard, in place of diameter. Reply: hole_index, body, x and y in the frame, off_plane with at, frame.",
"params": [
{"name": "type", "type": "string", "default": "simple", "enum": ["simple", "counterbore", "countersink"], "description": "the hole's seat for a screw head: none, a counterbore or a countersink"},
{"name": "diameter", "type": "number", "unit": "mm", "default": 5, "exclusive_min": 0, "description": "refused with designation, which gives it"},
{"name": "designation", "type": "string", "default": null, "description": "a standard clearance size, e.g. M6 or 1/4-20: the hole and its seat are the standard's; refused with diameter, cbore_*, csink_* and standard"},
{"name": "depth", "type": "number", "unit": "mm", "default": 10},
{"name": "through", "type": "boolean", "default": false},
{"name": "x", "type": "number", "unit": "mm", "default": 0, "description": "offset in the plane's frame from its origin, NOT world"},
{"name": "y", "type": "number", "unit": "mm", "default": 0, "description": "offset in the plane's frame from its origin, NOT world"},
{"name": "plane", "type": "string|object", "default": "XY", "description": "\"XY\", \"XZ\" or \"YZ\" through modeling_origin; {\"datum\": i}, a Plane feature; or {\"body\": b, \"face\": f}, a planar face to drill into that body (origin at its centroid, normal into the body, x along its longest edge). The reply's frame gives the axes."},
{"name": "at", "type": "array|object", "default": null, "description": "instead of x and y: a world point [x, y, z], projected onto the plane along its normal (off_plane says how far), or {\"body\": b, \"face\": f} a cylindrical face or {\"body\": b, \"edge\": e} a circular edge whose axis the hole shares. A world point moves with modeling_origin; x and y replay on any printer"},
{"name": "body", "type": "integer", "default": -1, "description": "the body to drill; omit for a face plane's body, else the last body"},
{"name": "cbore_diameter", "type": "number", "unit": "mm", "default": 0, "description": "with type counterbore, refused with the others: the counterbore's diameter"},
{"name": "cbore_depth", "type": "number", "unit": "mm", "default": 0, "description": "with type counterbore, refused with the others: its depth from the face"},
{"name": "csink_diameter", "type": "number", "unit": "mm", "default": 0, "description": "with type countersink, refused with the others: the countersink's diameter at the face"},
{"name": "csink_angle", "type": "number", "unit": "deg", "default": 90, "description": "with type countersink, refused with the others: its included angle"},
{"name": "standard", "type": "string", "default": "", "description": "the designation the hole was sized for, e.g. M6, kept with the feature; it sizes nothing"}
],
"examples": [
{
"title": "A 5 mm hole through the middle of a plate",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "hole", "args": {"diameter": 5, "through": true}}
]
},
{
"title": "A countersunk hole through a plate's top face",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "body_describe", "args": {"at_extreme": "+z", "body": 0}},
{"tool": "hole", "args": {"csink_angle": 90, "csink_diameter": 9, "diameter": 4.5, "generation": {"from_call": 1, "key": "generation"}, "plane": {"body": 0, "face": 5}, "through": true, "type": "countersink"}}
]
},
{
"title": "An M6 counterbored clearance hole through a 10 mm block's top face",
"calls": [
{"tool": "extrude", "args": {"distance": 10, "height": 30, "width": 30}},
{"tool": "body_describe", "args": {"at_extreme": "+z", "body": 0}},
{"tool": "hole", "args": {"designation": "M6", "generation": {"from_call": 1, "key": "generation"}, "plane": {"body": 0, "face": 5}, "through": true, "type": "counterbore"}}
]
}
],
"ids": true
}
},
{
"id": "thread",
"name": "Thread",
"section": "Solid",
"slot": "remove",
"key": "Shift+T",
"feature": "Thread",
"accepts": [
"face_cyl",
"edge_circ"
],
"needs": {
"bodies": 1
},
"refusal": "Pick a cylindrical surface (bore / outer) or a circular edge for a thread",
"gui": true,
"action": "key:S+T",
"icon": "design_thread",
"hint": "Thread a cylindrical surface (inner bore / outer) or a circular edge",
"tool": {
"access": "change",
"ok_false": false,
"summary": "Cut a thread as the Thread card does, along a cylindrical face or a circular edge, or on a plane.",
"details": "On a face a bore is tapped, a boss threaded; on a plane the thread goes at (x,y) or `at`. Without designation, a face or edge takes the nearest standard size, ISO metric and UTS alike. Long threads take seconds and the reply may be a job. Reply: thread_index, designation (null when custom), internal, diameter, pitch, depth, length, body, x, y, frame.",
"params": [
{"name": "face", "type": "integer", "default": null, "description": "a cylindrical face id of `body` (body_describe); the thread runs its length from its lower end"},
{"name": "edge", "type": "integer", "default": null, "description": "instead of face: a circular edge id of `body`, the thread rising along its normal; needs length"},
{"name": "body", "type": "integer", "default": -1, "description": "the body of face or edge, or the body threaded on a plane; omit for the last body (on a plane, a face plane's body)"},
{"name": "designation", "type": "string", "default": null, "description": "e.g. M5, M8x1, 1/4-20 UNC: sets diameter, pitch and depth"},
{"name": "internal", "type": "boolean", "default": null, "description": "true taps a hole, false threads a rod; required on a plane, else from the face (a bore is internal), external for an edge"},
{"name": "diameter", "type": "number", "unit": "mm", "default": null, "description": "nominal (major) diameter, replacing the standard's; with pitch, a custom thread"},
{"name": "pitch", "type": "number", "unit": "mm", "default": null, "description": "replaces the standard's"},
{"name": "depth", "type": "number", "unit": "mm", "default": null, "description": "radial depth; default the 60 degree V's for the pitch and role"},
{"name": "length", "type": "number", "unit": "mm", "default": null, "description": "default the face's length; required for an edge or a plane"},
{"name": "plane", "type": "string|object", "default": null, "nullable": false, "description": "\"XY\", \"XZ\" or \"YZ\" through modeling_origin; {\"datum\": i}, a Plane feature; or {\"body\": b, \"face\": f}, a planar face to drill into that body (origin at its centroid, normal into the body, x along its longest edge). The reply's frame gives the axes."},
{"name": "x", "type": "number", "unit": "mm", "default": 0, "description": "on a plane: offset in the plane's frame from its origin, NOT world"},
{"name": "y", "type": "number", "unit": "mm", "default": 0, "description": "on a plane: offset in the plane's frame from its origin, NOT world"},
{"name": "at", "type": "array|object", "default": null, "description": "on a plane, instead of x and y: a world point [x, y, z], or {\"body\": b, \"face\": f} a cylindrical face or {\"body\": b, \"edge\": e} a circular edge whose axis the thread shares, as hole takes it"}
],
"examples": [
{
"title": "An M8 thread tapped into a 6.8 mm hole through a block",
"calls": [
{"tool": "extrude", "args": {"distance": 10, "height": 20, "width": 20}},
{"tool": "hole", "args": {"diameter": 6.8, "through": true}},
{"tool": "body_describe", "args": {"body": 0, "kinds": ["cylindrical"]}},
{"tool": "thread", "args": {"body": 0, "designation": "M8", "face": 6, "generation": {"from_call": 2, "key": "generation"}}}
]
},
{
"title": "An M6 threaded rod 10 mm long, standing on the XY plane",
"calls": [
{"tool": "thread", "args": {"designation": "M6", "internal": false, "length": 10, "plane": "XY"}}
]
},
{
"title": "A 10 mm boss threaded at the nearest standard size, which the reply's designation names",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"entities": [{"center": [0, 0], "radius": 5, "type": "circle_center"}]}},
{"tool": "sketch_finish", "args": {}},
{"tool": "extrude", "args": {"distance": 12, "sketch": 0}},
{"tool": "body_describe", "args": {"body": 0, "kinds": ["cylindrical"]}},
{"tool": "thread", "args": {"body": 0, "face": 0, "generation": {"from_call": 4, "key": "generation"}}}
]
}
],
"ids": true
}
},
{
"id": "shell",
"name": "Shell",
"section": "Solid",
"slot": "remove",
"key": "Shift+K",
"feature": "Shell",
"accepts": [
"face_planar",
"body_solid"
],
"needs": {
"bodies": 1
},
"refusal": "Shell needs a solid body — add or import one first",
"gui": true,
"action": "key:S+K",
"icon": "design_shell",
"hint": "Hollow the body to a wall thickness, opening a picked face",
"tool": {
"access": "change",
"ok_false": true,
"summary": "Hollow a body to a wall thickness (inward); optionally leave one face open.",
"details": "",
"params": [
{"name": "thickness", "type": "number", "unit": "mm", "default": 1, "exclusive_min": 0},
{"name": "face", "type": "integer", "default": -1, "description": "face id to leave open (body_describe); omit for a closed hollow"},
{"name": "body", "type": "integer", "default": -1, "description": "target body; omit for the last body"}
],
"examples": [
{
"title": "A 20 x 20 x 10 mm box hollowed to 1.5 mm walls, open at the top",
"calls": [
{"tool": "extrude", "args": {"distance": 10, "height": 20, "width": 20}},
{"tool": "body_describe", "args": {"at_extreme": "+z", "body": 0}},
{"tool": "shell", "args": {"body": 0, "face": 5, "generation": {"from_call": 1, "key": "generation"}, "thickness": 1.5}}
]
},
{
"title": "A block hollowed to closed 2 mm walls",
"calls": [
{"tool": "extrude", "args": {"distance": 10, "height": 20, "width": 20}},
{"tool": "shell", "args": {"thickness": 2}}
]
}
],
"ids": true
}
},
{
"id": "split",
"name": "Cut",
"section": "Solid",
"slot": "remove",
"key": "Shift+X",
"feature": "Cut",
"accepts": [
"body_solid",
"datum_plane",
"face_planar",
"face_cyl",
"face_other",
"edge_str",
"edge_circ",
"vertex"
],
"needs": {
"bodies": 1
},
"refusal": "Cut needs a solid body — add or import one first",
"gui": true,
"action": "key:S+X",
"icon": "design_cut",
"hint": "Trim the body with a plane — drag the offset arrow; keep one half or both",
"tool": {
"access": "change",
"ok_false": false,
"summary": "Split a body with a plane, as the Cut card does, moved by offset and turned over by flip; or along the plane of a face.",
"details": "The upper piece is on the plane's normal side; keeping both makes two bodies, the lower one right after the upper. Reply: split_index, bodies, body, upper_body and lower_body (the pieces kept), frame (a plane's, after offset and flip).",
"params": [
{"name": "body", "type": "integer", "default": -1, "description": "target body; omit for the last body"},
{"name": "plane", "type": "string|object", "default": null, "description": "\"XY\", \"XZ\" or \"YZ\" through modeling_origin; {\"datum\": i}, a Plane feature; or {\"body\": b, \"face\": f}, a planar face (origin at its centroid, normal out of the body, x from the world axes). The reply's frame gives the axes."},
{"name": "offset", "type": "number", "unit": "mm", "default": 0, "description": "with plane: along its normal"},
{"name": "flip", "type": "boolean", "default": false, "description": "with plane: turn it over, swapping upper and lower"},
{"name": "face", "type": "integer", "default": null, "description": "instead of plane: a face id (body_describe) to split along"},
{"name": "face_body", "type": "integer", "default": -1, "description": "with face: the body that owns it; -1 = target"},
{"name": "keep_upper", "type": "boolean", "default": true},
{"name": "keep_lower", "type": "boolean", "default": true}
],
"examples": [
{
"title": "A block cut in two at half its height",
"calls": [
{"tool": "extrude", "args": {"distance": 10, "height": 20, "width": 20}},
{"tool": "split", "args": {"offset": 5, "plane": "XY"}}
]
},
{
"title": "A block cut at half its height, keeping only the lower half",
"calls": [
{"tool": "extrude", "args": {"distance": 10, "height": 20, "width": 20}},
{"tool": "split", "args": {"keep_upper": false, "offset": 5, "plane": "XY"}}
]
},
{
"title": "A block split along the top face of a wider plate",
"calls": [
{"tool": "extrude", "args": {"distance": 10, "height": 20, "width": 20}},
{"tool": "extrude", "args": {"distance": 4, "height": 30, "operation": "new_body", "width": 30}},
{"tool": "body_describe", "args": {"at_extreme": "+z", "body": 1}},
{"tool": "split", "args": {"body": 0, "face": 5, "face_body": 1, "generation": {"from_call": 2, "key": "generation"}}}
]
}
],
"ids": true
}
},
{
"id": "fillet",
"name": "Fillet",
"section": "Solid",
"slot": "dressup",
"key": "Shift+F",
"feature": "Fillet",
"accepts": [
"edge_str",
"edge_circ",
"face_planar",
"body_solid"
],
"needs": {
"bodies": 1
},
"refusal": "Pick an edge to round",
"gui": true,
"action": "btn:dress#0",
"icon": "design_filletedge",
"hint": "Pick an edge, then drag the radius arrow or type it",
"tool": {
"access": "change",
"ok_false": false,
"summary": "Round measured edges of a body (edge ids from body_describe on that body).",
"details": "Reply: fillet_index, body, bodies.",
"params": [
{"name": "edges", "type": "integer|array|string", "description": "one edge id, or an array of ids rounded together in one feature; or an edge group, the card's Edges choice: \"top\", \"bottom\", \"lateral\" or \"all\""},
{"name": "radius", "type": "number", "unit": "mm", "default": 1, "exclusive_min": 0},
{"name": "body", "type": "integer", "default": -1, "description": "target body; omit for the last body. The edge ids are resolved against this body."}
],
"examples": [
{
"title": "A plate's four vertical corners rounded to 2 mm",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "body_describe", "args": {"body": 0, "convex": true, "direction": [0, 0, 1], "edge_kinds": ["line"]}},
{"tool": "fillet", "args": {"body": 0, "edges": [0, 1, 4, 7], "generation": {"from_call": 1, "key": "generation"}, "radius": 2}}
]
},
{
"title": "One top edge of a plate rounded to 1 mm",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "body_describe", "args": {"adjacency": true, "at_extreme": "+z", "body": 0}},
{"tool": "fillet", "args": {"body": 0, "edges": 3, "generation": {"from_call": 1, "key": "generation"}, "radius": 1}}
]
}
],
"ids": true
}
},
{
"id": "chamfer",
"name": "Chamfer",
"section": "Solid",
"slot": "dressup",
"key": null,
"feature": "Chamfer",
"accepts": [
"edge_str",
"edge_circ",
"face_planar",
"body_solid"
],
"needs": {
"bodies": 1
},
"refusal": "Pick an edge to bevel",
"gui": true,
"action": "btn:dress#1",
"icon": "design_chamfer",
"hint": "Pick an edge, then drag the distance arrow or type it",
"tool": {
"access": "change",
"ok_false": false,
"summary": "Chamfer measured edges of a body (edge ids from body_describe on that body).",
"details": "Reply: chamfer_index, body, bodies.",
"params": [
{"name": "edges", "type": "integer|array|string", "description": "one edge id, or an array of ids chamfered together in one feature; or an edge group, the card's Edges choice: \"top\", \"bottom\", \"lateral\" or \"all\""},
{"name": "distance", "type": "number", "unit": "mm", "default": 1, "exclusive_min": 0},
{"name": "body", "type": "integer", "default": -1, "description": "target body; omit for the last body. The edge ids are resolved against this body."}
],
"examples": [
{
"title": "A plate's top edges chamfered 1 mm",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "body_describe", "args": {"adjacency": true, "at_extreme": "+z", "body": 0}},
{"tool": "chamfer", "args": {"body": 0, "distance": 1, "edges": [3, 6, 9, 11], "generation": {"from_call": 1, "key": "generation"}}}
]
}
],
"ids": true
}
},
{
"id": "draft",
"name": "Draft",
"section": "Solid",
"slot": "dressup",
"key": "Shift+D",
"feature": "Draft",
"accepts": [
"face_planar",
"face_other"
],
"needs": {
"bodies": 1
},
"refusal": "Pick a face to taper",
"gui": true,
"action": "key:S+D",
"icon": "design_draft",
"hint": "Tilt a picked face by a draft angle",
"tool": {
"access": "change",
"ok_false": true,
"summary": "Taper a body face by an angle about its base (pull direction +Z).",
"details": "",
"params": [
{"name": "face", "type": "integer", "description": "face id to draft (body_describe)"},
{"name": "angle", "type": "number", "unit": "deg", "default": 5},
{"name": "body", "type": "integer", "default": -1, "description": "target body; omit for the last body"}
],
"examples": [
{
"title": "A block's +X side tapered 5 degrees",
"calls": [
{"tool": "extrude", "args": {"distance": 10, "height": 20, "width": 20}},
{"tool": "body_describe", "args": {"body": 0, "direction": [1, 0, 0]}},
{"tool": "draft", "args": {"angle": 5, "body": 0, "face": 1, "generation": {"from_call": 1, "key": "generation"}}}
]
}
],
"ids": true
}
},
{
"id": "surface_offset",
"name": "Surface Offset",
"section": "Surface",
"slot": "dressup",
"key": null,
"feature": "SurfaceOffset",
"accepts": [
"body_sheet"
],
"needs": {
"sheet": true
},
"refusal": "Surface Offset needs a surface body — make one with a Surface tool first",
"gui": true,
"action": "fly:surface#4",
"icon": "design_offset",
"hint": "Offset a sheet body's shell by a signed distance",
"tool": {
"access": "change",
"ok_false": true,
"summary": "Offset a sheet body by a signed distance -> another sheet body.",
"details": "A positive offset moves each face along its normal, the one body_describe gives, and a negative one against it, so the side depends on how the sheet was made: an extruded circle's normal points inward.",
"params": [
{"name": "body", "type": "integer", "default": -1, "description": "sheet body; omit for the last body"},
{"name": "offset", "type": "number", "unit": "mm", "default": 1}
],
"examples": [
{
"title": "A rectangular sheet copied 5 mm above itself",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"p0": [-15, -10], "p1": [15, 10], "type": "rectangle_2_point"}},
{"tool": "sketch_finish", "args": {}},
{"tool": "surface_patch", "args": {"sketch": 0}},
{"tool": "surface_offset", "args": {"offset": 5}}
]
},
{
"title": "An open tube of radius 10 mm offset -2 mm, against its inward normal, to one of radius 12 mm",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"entities": [{"center": [0, 0], "radius": 10, "type": "circle_center"}]}},
{"tool": "sketch_finish", "args": {}},
{"tool": "surface_extrude", "args": {"distance": 20, "sketch": 0}},
{"tool": "surface_offset", "args": {"body": 0, "offset": -2}}
]
}
],
"ids": false
}
},
{
"id": "pattern",
"name": "Linear pattern",
"section": "Solid",
"slot": "repeat",
"key": "Shift+N",
"feature": "Pattern",
"accepts": [
"body_solid",
"face_planar",
"sk_loop",
"art"
],
"needs": {
"bodies": 1
},
"refusal": "Pattern needs a solid body — add or import one first",
"gui": true,
"action": "btn:pat#0",
"icon": "design_array",
"hint": "Repeat the body along a direction — drag the spacing, set the count",
"args": {"type": "linear"},
"tool": {
"access": "change",
"ok_false": false,
"summary": "Replicate a body in a row, around the plane's normal, or along a sketch curve.",
"details": "linear places count copies along a plane axis at spacing; circular spreads them over angle about the plane's normal through its origin; curve places them at equal-parameter points on a sketch entity, each translated by (P_i - P_0). An argument of one type is refused with another. Reply: pattern_index, bodies, and for linear and circular the frame.",
"params": [
{"name": "type", "type": "string", "default": "linear", "enum": ["linear", "circular", "curve"], "description": "the copies' layout: in a row, around the plane's normal, or along a sketch curve"},
{"name": "count", "type": "integer", "default": 3, "min": 1},
{"name": "spacing", "type": "number", "unit": "mm", "default": 10, "description": "with type linear, refused with the others: the step between copies"},
{"name": "dir", "type": "integer", "default": 0, "enum": [0, 1], "description": "with type linear, refused with the others: the axis, 0=plane X, 1=plane Y"},
{"name": "angle", "type": "number", "unit": "deg", "default": 360, "description": "with type circular, refused with the others: the total sweep"},
{"name": "plane", "type": "string|object", "default": "XY", "description": "with type linear or circular, refused with curve: \"XY\", \"XZ\" or \"YZ\" through modeling_origin; {\"datum\": i}, a Plane feature; or {\"body\": b, \"face\": f}, a planar face (origin at its centroid, normal out of the body, x from the world axes). The reply's frame gives the axes."},
{"name": "body", "type": "integer", "default": -1, "description": "target body; omit for the last body"},
{"name": "sketch", "type": "integer", "default": null, "description": "with type curve, which requires it: the feature index of the sketch holding the guide curve; refused with the other types"},
{"name": "entity", "type": "integer", "default": null, "description": "with type curve, which requires it: the guide curve's entity index within that sketch; refused with the other types"}
],
"examples": [
{
"title": "Three plates 30 mm apart along X",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "pattern", "args": {"count": 3, "spacing": 30}}
]
},
{
"title": "Six blocks in a circle about the XY plane's normal",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "profile": [[20, -3], [30, -3], [30, 3], [20, 3]]}},
{"tool": "pattern", "args": {"count": 6, "type": "circular"}}
]
},
{
"title": "Four pegs spaced along a half circle",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"entities": [{"center": [0, 0], "end_angle_deg": 180, "radius": 30, "start_angle_deg": 0, "type": "arc_center"}]}},
{"tool": "sketch_finish", "args": {}},
{"tool": "extrude", "args": {"distance": 10, "profile": [[28, -2], [32, -2], [32, 2], [28, 2]]}},
{"tool": "pattern", "args": {"count": 4, "entity": 0, "sketch": 0, "type": "curve"}}
]
}
],
"ids": true
}
},
{
"id": "pattern_circular",
"name": "Circular pattern",
"slot": "repeat",
"key": null,
"feature": "Pattern",
"accepts": [
"body_solid",
"face_planar",
"sk_loop",
"art"
],
"needs": {
"bodies": 1
},
"refusal": "Pattern needs a solid body — add or import one first",
"gui": true,
"action": "btn:pat#1",
"mode": null,
"icon": "design_polararray",
"hint": "Repeat the body around an axis — set the count and sweep",
"fold": {"into": "pattern", "args": {"type": "circular"}}
},
{
"id": "mirror",
"name": "Mirror",
"section": "Solid",
"slot": "repeat",
"key": "Shift+Z",
"feature": "Mirror",
"accepts": [
"body_solid",
"datum_plane",
"face_planar",
"face_cyl",
"face_other",
"edge_str",
"edge_circ",
"vertex"
],
"needs": {
"bodies": 1
},
"refusal": "Mirror needs a body — add or import one first",
"gui": true,
"action": "key:S+Z",
"icon": "design_mirror",
"hint": "Reflect a body about a plane",
"tool": {
"access": "change",
"ok_false": true,
"summary": "Mirror a body about a base plane.",
"details": "operation new_body makes a mirrored copy; join fuses the mirror back into the source.",
"params": [
{"name": "plane", "type": "string|object", "default": "XZ", "description": "\"XY\", \"XZ\" or \"YZ\" through modeling_origin; {\"datum\": i}, a Plane feature; or {\"body\": b, \"face\": f}, a planar face (origin at its centroid, normal out of the body, x from the world axes). The reply's frame gives the axes."},
{"name": "operation", "type": "string", "default": "new_body", "enum": ["new_body", "join"], "description": "what the mirror does to the source body: new_body makes a body of its own, join fuses it into the source"},
{"name": "keep_original", "type": "boolean", "default": true, "description": "with operation new_body, keep the source body"},
{"name": "body", "type": "integer", "default": -1, "description": "target body; omit for the last body"}
],
"examples": [
{
"title": "A mirrored copy of a block across the XZ plane",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "profile": [[-5, 5], [5, 5], [5, 15], [-5, 15]]}},
{"tool": "mirror", "args": {"plane": "XZ"}}
]
},
{
"title": "A block against the XZ plane and its mirror image fused into one body",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "profile": [[-5, 0], [5, 0], [5, 10], [-5, 10]]}},
{"tool": "mirror", "args": {"operation": "join", "plane": "XZ"}}
]
}
],
"ids": true
}
},
{
"id": "pat_curve",
"name": "Pattern on Curve",
"slot": "repeat",
"key": null,
"feature": "Pattern",
"accepts": [
"body_solid",
"edge_str"
],
"needs": {
"bodies": 1
},
"refusal": "Pattern on Curve needs a body and a curve",
"gui": false,
"action": null,
"icon": null,
"hint": "Repeat the body along a picked curve"
},
{
"id": "body_transform",
"name": "Move",
"section": "Bodies",
"slot": "transform",
"key": "Shift+Y",
"feature": "Transform",
"accepts": [
"body_solid",
"body_sheet",
"art",
"face_planar",
"face_cyl",
"face_other",
"edge_str",
"edge_circ",
"vertex"
],
"needs": {
"bodies": 1
},
"refusal": "Transform needs a body — add or import one first",
"gui": true,
"action": "key:S+Y",
"icon": "design_move",
"hint": "Move and/or rotate an existing body",
"tool": {
"access": "change",
"ok_false": true,
"summary": "Move and/or rotate a body (B-rep transform).",
"details": "copy=true keeps the source and appends the transformed copy as a new body. The rotation is angle about the axis (axis_x, axis_y, axis_z) through the pivot, a world point that defaults to the world origin.",
"params": [
{"name": "body", "type": "integer", "default": -1, "description": "target body; omit for the last body"},
{"name": "dx", "type": "number", "unit": "mm", "default": 0},
{"name": "dy", "type": "number", "unit": "mm", "default": 0},
{"name": "dz", "type": "number", "unit": "mm", "default": 0},
{"name": "axis_x", "type": "number", "default": 0},
{"name": "axis_y", "type": "number", "default": 0},
{"name": "axis_z", "type": "number", "default": 1},
{"name": "pivot_x", "type": "number", "unit": "mm", "default": 0},
{"name": "pivot_y", "type": "number", "unit": "mm", "default": 0},
{"name": "pivot_z", "type": "number", "unit": "mm", "default": 0},
{"name": "angle", "type": "number", "unit": "deg", "default": 0},
{"name": "copy", "type": "boolean", "default": false}
],
"examples": [
{
"title": "A plate moved 30 mm along X",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "body_transform", "args": {"dx": 30}}
]
},
{
"title": "A copy of a plate 10 mm above it",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "body_transform", "args": {"copy": true, "dz": 10}}
]
}
],
"ids": false
}
},
{
"id": "align",
"name": "Mate",
"section": "Solid",
"slot": "transform",
"key": null,
"feature": "Mate",
"accepts": [
"coordsys",
"bodies_2",
"face_planar"
],
"needs": {
"bodies": 2
},
"refusal": "Mate needs two coordinate systems — create them first",
"gui": true,
"action": "fly:placement#2",
"icon": "design_c_coincident",
"hint": "Assembly: align two coordinate systems (fastened, planar, revolute, slider, cylindrical)",
"tool": {
"access": "change",
"ok_false": false,
"summary": "Align two bodies: transform the moving body (cs_b) so its connector lands on the fixed one (cs_a).",
"details": "An align that cannot hold with those before it is listed in describe_design's align_conflicts, with the reason. Reply: align_index, bodies.",
"params": [
{"name": "type", "type": "string", "default": "fastened", "enum": ["fastened", "planar", "revolute", "slider", "cylindrical"], "description": "fastened is rigid; planar matches the normal only; revolute leaves rotation about the axis free; slider translation along it; cylindrical both"},
{"name": "cs_a", "type": "integer", "description": "feature index of the fixed CoordSys (mate connector A)"},
{"name": "cs_b", "type": "integer", "description": "feature index of the CoordSys on the body that moves"},
{"name": "offset", "type": "number", "unit": "mm", "default": 0},
{"name": "angle", "type": "number", "unit": "deg", "default": 0},
{"name": "flip", "type": "boolean", "default": false}
],
"examples": [
{
"title": "A block stood on a plate: its bottom-face connector fastened, turned over, to the plate's top-face one",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "extrude", "args": {"distance": 10, "operation": "new_body", "profile": [[30, -5], [40, -5], [40, 5], [30, 5]]}},
{"tool": "body_describe", "args": {"at_extreme": "+z", "body": 0}},
{"tool": "construct_coordinate_system", "args": {"body": 0, "face": 5, "generation": {"from_call": 2, "key": "generation"}, "type": "face_and_direction"}},
{"tool": "body_describe", "args": {"at_extreme": "-z", "body": 1}},
{"tool": "construct_coordinate_system", "args": {"body": 1, "face": 4, "generation": {"from_call": 4, "key": "generation"}, "type": "face_and_direction"}},
{"tool": "align", "args": {"cs_a": 4, "cs_b": 5, "flip": true, "type": "fastened"}}
]
}
],
"ids": false
}
},
{
"id": "align_to",
"name": "Align to",
"slot": "transform",
"key": null,
"feature": "Transform",
"accepts": [
"face_planar"
],
"needs": {
"bodies": 1
},
"refusal": "Align needs a body — add or import one first",
"gui": false,
"action": null,
"icon": null,
"hint": "Align the body to a picked face or plane"
},
{
"id": "construct_plane",
"name": "Plane",
"section": "Construct",
"slot": "reference",
"key": "Shift+P",
"feature": "Plane",
"accepts": [
"none",
"face_planar",
"edge_str",
"datum_plane",
"vertex"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "key:S+P",
"icon": "design_plane",
"hint": "Reference plane (offset / tilt / midplane / tangent / two edges / coincident)",
"tool": {
"access": "change",
"ok_false": false,
"summary": "Add a datum plane as the Plane card does, to sketch or build on as {\"datum\": plane_index}.",
"details": "Offset from a base plane or a face, at an angle about an edge, midway between two faces, tangent to a cylindrical face, through two edges, or coincident with a base plane or a face. Not the `plane` param of other Design commands. Reply: plane_index, name, frame.",
"params": [
{"name": "type", "type": "string", "default": "offset", "enum": ["offset", "angle", "midplane", "tangent", "two_edges", "coincident"]},
{"name": "base", "type": "string|object", "default": "XY", "description": "\"XY\", \"XZ\" or \"YZ\" through modeling_origin, or {\"datum\": i}: what offset, coincident and angle build on without face_a"},
{"name": "offset", "type": "number", "unit": "mm", "default": 20, "description": "offset: distance along the normal of base or face_a"},
{"name": "angle", "type": "number", "unit": "deg", "default": 0, "description": "offset without face_a: tilt about the base axis `axis`; angle: turn about edge_a from the reference plane; tangent: position around the cylinder"},
{"name": "axis", "type": "integer", "default": 0, "enum": [0, 1], "description": "offset without face_a: tilt about the base plane's X (0) or Y (1) axis"},
{"name": "face_a", "type": "object", "default": null, "description": "Face A, {\"body\": b, \"face\": f}: offset or coincident on a face; angle's reference plane; midplane's first face; tangent's cylindrical face"},
{"name": "face_b", "type": "object", "default": null, "description": "Face B, {\"body\": b, \"face\": f}: midplane's second face"},
{"name": "edge_a", "type": "object", "default": null, "description": "Edge A, {\"body\": b, \"edge\": e}: angle's hinge; two_edges' first edge"},
{"name": "edge_b", "type": "object", "default": null, "description": "Edge B, {\"body\": b, \"edge\": e}: two_edges' second edge"},
{"name": "size", "type": "array", "unit": "mm", "default": [60, 60], "description": "[u, v]: the size the plane is drawn at"}
],
"examples": [
{
"title": "A datum plane 20 mm above XY",
"calls": [
{"tool": "construct_plane", "args": {"base": "XY", "offset": 20, "type": "offset"}}
]
},
{
"title": "A datum plane midway between a block's top and bottom faces",
"calls": [
{"tool": "extrude", "args": {"distance": 10, "height": 20, "width": 20}},
{"tool": "body_describe", "args": {"body": 0, "kinds": ["planar"]}},
{"tool": "construct_plane", "args": {"face_a": {"body": 0, "face": 4}, "face_b": {"body": 0, "face": 5}, "generation": {"from_call": 1, "key": "generation"}, "type": "midplane"}}
]
},
{
"title": "A datum plane turned 30 degrees from a plate's top face about its front edge",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "body_describe", "args": {"adjacency": true, "at_extreme": "+z", "body": 0}},
{"tool": "construct_plane", "args": {"angle": 30, "edge_a": {"body": 0, "edge": 3}, "face_a": {"body": 0, "face": 5}, "generation": {"from_call": 1, "key": "generation"}, "type": "angle"}}
]
}
],
"ids": true
}
},
{
"id": "construct_axis",
"name": "Axis",
"section": "Construct",
"slot": "reference",
"key": "Shift+A",
"feature": "Axis",
"accepts": [
"none",
"face_planar",
"face_cyl",
"edge_str",
"vertex"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "key:S+A",
"icon": "design_line",
"hint": "Datum axis (two points, face normal, cylinder centerline, two planes, along edge)",
"tool": {
"access": "change",
"ok_false": true,
"summary": "Create a datum axis (reference line): two points, face normal, cylinder centreline, plane intersection, or along edge.",
"details": "",
"params": [
{"name": "type", "type": "string", "default": "two_points", "enum": ["two_points", "face_normal", "cylinder", "plane_intersection", "along_edge"]},
{"name": "p1", "type": "array", "default": [0, 0, 0], "description": "first point [x,y,z] for two_points"},
{"name": "p2", "type": "array", "default": [0, 0, 10], "description": "second point [x,y,z] for two_points"},
{"name": "body", "type": "integer", "default": -1, "description": "body for face/edge refs"},
{"name": "face", "type": "integer", "default": -1, "description": "face id (body_describe) for face_normal/cylinder"},
{"name": "edge", "type": "integer", "default": -1, "description": "edge id (body_describe) for along_edge"},
{"name": "plane_a", "type": "integer", "default": -1, "description": "first datum plane feature index for plane_intersection"},
{"name": "plane_b", "type": "integer", "default": -1, "description": "second datum plane feature index for plane_intersection"}
],
"examples": [
{
"title": "The axis of a hole through a plate",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "hole", "args": {"diameter": 5, "through": true}},
{"tool": "body_describe", "args": {"body": 0, "kinds": ["cylindrical"]}},
{"tool": "construct_axis", "args": {"body": 0, "face": 6, "generation": {"from_call": 2, "key": "generation"}, "type": "cylinder"}}
]
},
{
"title": "The normal through the centre of a plate's top face",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "body_describe", "args": {"at_extreme": "+z", "body": 0}},
{"tool": "construct_axis", "args": {"body": 0, "face": 5, "generation": {"from_call": 1, "key": "generation"}, "type": "face_normal"}}
]
},
{
"title": "The vertical line where two datum planes meet",
"calls": [
{"tool": "construct_plane", "args": {"base": "XZ", "offset": 10, "type": "offset"}},
{"tool": "construct_plane", "args": {"base": "YZ", "offset": 10, "type": "offset"}},
{"tool": "construct_axis", "args": {"plane_a": 0, "plane_b": 1, "type": "plane_intersection"}}
]
}
],
"ids": true
}
},
{
"id": "construct_coordinate_system",
"name": "Coordinate system",
"section": "Construct",
"slot": "reference",
"key": "Shift+C",
"feature": "CoordSys",
"accepts": [
"none",
"face_planar",
"vertex"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "key:S+C",
"icon": "design_point",
"hint": "Datum coordinate system (world point, or face + direction edge)",
"tool": {
"access": "change",
"ok_false": true,
"summary": "Create a datum coordinate system (origin + orthonormal axes).",
"details": "PointWorld aligns to world; FaceAndDirection uses a face for Z and an edge/hint for X.",
"params": [
{"name": "type", "type": "string", "default": "point_world", "enum": ["point_world", "face_and_direction"]},
{"name": "point", "type": "array", "default": [0, 0, 0], "description": "origin [x,y,z] for point_world"},
{"name": "body", "type": "integer", "default": -1, "description": "body for face/edge refs"},
{"name": "face", "type": "integer", "default": -1, "description": "face id (body_describe) for Z axis"},
{"name": "edge", "type": "integer", "default": -1, "description": "edge id (body_describe) for X axis hint"},
{"name": "x_hint", "type": "array", "default": [1, 0, 0], "description": "fallback X direction hint if no edge given"}
],
"examples": [
{
"title": "A connector on a plate's top face, its x axis along the front edge",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "body_describe", "args": {"adjacency": true, "at_extreme": "+z", "body": 0}},
{"tool": "construct_coordinate_system", "args": {"body": 0, "edge": 3, "face": 5, "generation": {"from_call": 1, "key": "generation"}, "type": "face_and_direction"}}
]
}
],
"ids": true
}
},
{
"id": "helix",
"name": "Helix",
"section": "Construct",
"slot": "reference",
"key": null,
"feature": "Helix",
"accepts": [
"none",
"datum_plane",
"face_cyl"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "fly:plane#3",
"icon": "design_thread",
"hint": "Helical curve (spring path) — use as a sweep path for coils / springs / augers",
"tool": {
"access": "change",
"ok_false": false,
"summary": "Create a helical curve, a sweep path for springs, coils and augers.",
"details": "It starts on the plane's x axis at `radius` from its origin. pitch = axial rise per turn. left_handed flips the winding. taper_deg != 0 gives a conical helix. Reply: helix_index, frame, start and tangent (world), to draw a sweep's profile across the curve there.",
"params": [
{"name": "radius", "type": "number", "unit": "mm", "default": 10, "exclusive_min": 0},
{"name": "pitch", "type": "number", "unit": "mm", "default": 5, "exclusive_min": 0},
{"name": "height", "type": "number", "unit": "mm", "default": 20, "exclusive_min": 0},
{"name": "left_handed", "type": "boolean", "default": false},
{"name": "taper_deg", "type": "number", "unit": "deg", "default": 0},
{"name": "plane", "type": "string|object", "default": "XY", "description": "\"XY\", \"XZ\" or \"YZ\" through modeling_origin; {\"datum\": i}, a Plane feature; or {\"body\": b, \"face\": f}, a planar face (origin at its centroid, normal out of the body, x from the world axes). The reply's frame gives the axes."}
],
"examples": [
{
"title": "A four-turn helix on XY: radius 10 mm, pitch 5 mm, 20 mm tall",
"calls": [
{"tool": "helix", "args": {"height": 20, "pitch": 5, "radius": 10}}
]
},
{
"title": "A left-handed conical helix tapering 10 degrees",
"calls": [
{"tool": "helix", "args": {"height": 20, "left_handed": true, "pitch": 4, "radius": 10, "taper_deg": 10}}
]
}
],
"ids": true
}
},
{
"id": "sketch_project",
"name": "Project",
"section": "Sketch",
"slot": "reference",
"key": null,
"feature": "Project",
"accepts": [
"body_solid",
"face_planar",
"datum_plane"
],
"needs": {
"bodies": 1
},
"refusal": "Project needs a body — add or import one first",
"gui": true,
"action": "fly:plane#4",
"icon": "design_sketch",
"hint": "Project body edges onto a plane as sketch entities",
"tool": {
"access": "sketch",
"ok_false": true,
"summary": "Project a body's edges onto a plane as a new sketch, or into the open sketch as construction entities.",
"details": "With no sketch open it adds a Project feature on plane, a sketch whose entities follow the body as it rebuilds; reply: scope \"feature\", project_index, bodies, error, frame. With a sketch open, a new one or one re-opened with sketch_edit, the edges are copied into it on its plane as construction entities, which new geometry can be constrained to and which do not follow the body; plane is refused there; reply: scope \"sketch\", first_index, added, entities (how many the sketch has).",
"params": [
{"name": "source_body", "type": "integer", "default": -1, "description": "body owning the edges; -1 = last body"},
{"name": "face", "type": "integer", "default": -1, "description": "global face id on the source body; when set, all its edges are projected"},
{"name": "edges", "type": "array", "default": [], "description": "global edge ids to project; empty => project the face"},
{"name": "plane", "type": "string|object", "default": null, "description": "with no sketch open, the plane of the new sketch: \"XY\" (left out or null), \"XZ\" or \"YZ\" through modeling_origin; {\"datum\": i}, a Plane feature; or {\"body\": b, \"face\": f}, a planar face (origin at its centroid, normal out of the body, x from the world axes). The reply's frame gives the axes. With a sketch open, refused: the edges go on its plane."}
],
"examples": [
{
"title": "A plate's top-face outline projected onto the XY plane as a new sketch",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "body_describe", "args": {"at_extreme": "+z", "body": 0}},
{"tool": "sketch_project", "args": {"face": 5, "generation": {"from_call": 1, "key": "generation"}, "plane": "XY", "source_body": 0}}
]
},
{
"title": "Two top edges of a plate, meeting at a corner, projected onto the XY plane",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "body_describe", "args": {"adjacency": true, "at_extreme": "+z", "body": 0}},
{"tool": "sketch_project", "args": {"edges": [3, 6], "generation": {"from_call": 1, "key": "generation"}, "plane": "XY", "source_body": 0}}
]
},
{
"title": "A plate's top-face outline drawn into an open sketch as construction entities",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "body_describe", "args": {"at_extreme": "+z", "body": 0}},
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_project", "args": {"face": 5, "generation": {"from_call": 1, "key": "generation"}, "source_body": 0}}
]
}
],
"ids": true
}
},
{
"id": "measure",
"name": "Measure",
"section": "Inspect",
"slot": "reference",
"key": null,
"feature": null,
"accepts": [
"face_planar",
"face_cyl",
"face_other",
"edge_str",
"edge_circ",
"vertex",
"body_solid",
"body_sheet",
"bodies_2",
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": false,
"action": null,
"icon": null,
"hint": "Measure between the picked points, edges or faces",
"tool": {
"access": "read",
"ok_false": false,
"summary": "Measure two refs, on one body or two: distance, closest points, angle and the gap between parallel faces.",
"details": "distance is between their representative points (a face's centroid, an edge's middle, an axis's middle); min_distance comes with closest_a and closest_b; angle_deg when both have a direction; parallel_gap across two parallel planar faces.",
"params": [
{"name": "body", "type": "integer", "default": 0, "description": "the body of a ref that names none"},
{"name": "a", "type": "object", "description": "{\"face\": f}, {\"edge\": e} or {\"point\": [x, y, z]}, with an optional \"body\"; {\"face\": f, \"axis\": true} is a cylindrical face's axis over its length"},
{"name": "b", "type": "object", "description": "as a"}
],
"examples": [
{
"title": "A plate's thickness, between its top and bottom faces",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "body_describe", "args": {"body": 0, "kinds": ["planar"]}},
{"tool": "measure", "args": {"a": {"face": 5}, "b": {"face": 4}, "body": 0, "generation": {"from_call": 1, "key": "generation"}}}
]
},
{
"title": "The 10 mm gap between two blocks' facing sides",
"calls": [
{"tool": "extrude", "args": {"distance": 10, "height": 20, "width": 20}},
{"tool": "extrude", "args": {"distance": 10, "operation": "new_body", "profile": [[20, -5], [30, -5], [30, 5], [20, 5]]}},
{"tool": "body_describe", "args": {"body": 0, "direction": [1, 0, 0]}},
{"tool": "body_describe", "args": {"body": 1, "direction": [-1, 0, 0]}},
{"tool": "measure", "args": {"a": {"body": 0, "face": 1}, "b": {"body": 1, "face": 3}, "generation": {"from_call": 3, "key": "generation"}}}
]
}
],
"ids": true
}
},
{
"id": "body_mass_properties",
"name": "Volume and area",
"section": "Inspect",
"slot": "reference",
"key": null,
"feature": null,
"accepts": [
"body_solid",
"face_planar",
"face_cyl",
"face_other",
"edge_str",
"edge_circ",
"vertex"
],
"needs": {
"bodies": 1
},
"refusal": null,
"gui": true,
"action": "btn:mass",
"icon": "info",
"hint": "Report the volume and surface area of the selected body",
"tool": {
"access": "read",
"ok_false": false,
"summary": "Volume / surface area / centre of mass / inertia tensor of a body.",
"details": "",
"params": [
{"name": "body", "type": "integer", "default": 0}
],
"examples": [
{
"title": "The volume and centre of mass of a 20 x 20 x 5 mm plate",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "body_mass_properties", "args": {"body": 0}}
]
}
],
"ids": false
}
},
{
"id": "interference",
"name": "Interference",
"section": "Inspect",
"slot": "reference",
"key": null,
"feature": null,
"accepts": [
"body_solid",
"bodies_2"
],
"needs": {
"bodies": 2
},
"refusal": "Interference needs at least two bodies",
"gui": true,
"action": "btn:interference",
"icon": "design_boolean",
"hint": "Check whether two bodies overlap — reports, changes nothing",
"tool": {
"access": "read",
"ok_false": false,
"summary": "Solid bodies that overlap, as {body_a, body_b, volume}.",
"details": "Read-only; bodies that merely touch enclose no volume and are not reported.",
"params": [
{"name": "min_volume", "type": "number", "unit": "mm^3", "default": 1e-06, "description": "overlap volume above which a pair counts as interfering"}
],
"examples": [
{
"title": "A post standing in a block: the two overlap",
"calls": [
{"tool": "extrude", "args": {"distance": 10, "height": 20, "width": 20}},
{"tool": "extrude", "args": {"distance": 20, "height": 10, "operation": "new_body", "width": 10}},
{"tool": "interference", "args": {"silent": true}}
]
}
],
"ids": false
}
},
{
"id": "feature_edit",
"name": "Edit",
"section": "History",
"slot": "modify",
"key": null,
"feature": null,
"accepts": [
"body_solid",
"face_planar",
"face_cyl",
"face_other",
"sk_loop",
"art",
"datum_plane",
"datum_axis",
"coordsys",
"body_sheet"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "btn:edit",
"icon": "design_edit",
"hint": "Reopen the selected feature to change what it was made from",
"feature_row": true,
"tool": {
"access": "change",
"ok_false": false,
"summary": "Change a feature's fields and what it refers to, as its card's Confirm does when editing: one undo step, a rebuild.",
"details": "fields, then refs, are written; a call with neither is refused, and a field an expression drives is refused. Body indices and face and edge ids in refs are those of the model just before the feature, which body_describe {before: feature} reads and feature_describe's bodies_before lists; a Plane's, an Axis's and a CoordSys's are the finished model's (feature_describe's ids_of says which). An extrude's profile and target are fixed. Reply: changed {name: [old, new]}.",
"params": [
{"name": "feature", "type": "integer", "description": "feature index (describe_design)"},
{"name": "fields", "type": "object", "default": {}, "description": "{field: value} from feature_describe's editable, e.g. {\"distance\": 15}: numbers within its ranges; operation new_body|join|cut|intersect; extrude_end blind|symmetric|two_sided|through_all; shape rectangle|circle; xf_* vectors [x, y, z]; imported art's import_offset [x, y]; a Text feature's text_string, text_height (0.5 to 500 mm) and text_font, a face name (with text_bold, text_italic) or the stored value, which outline it again"},
{"name": "refs", "type": "object", "default": {}, "description": "{name: value} under the names of feature_describe's refs that the feature's card can pick again: revolve_axis_entity; sweep_path_ref; loft_profile_refs; target_body, bool_tool_body; plane (as sketch_create's plane) for a mirror, split, helix, hole or thread; rib_sketch_ref, rib_entity; mate_cs_a, mate_cs_b; a fillet's or chamfer's edges, or face_group top|bottom|lateral|all; shell_face, draft_face, thicken_face; delete_faces; a datum's plane_, axis_ and coordsys_ refs. Feature indices must come before the feature"}
],
"examples": [
{
"title": "A plate made 15 mm thick",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "feature_edit", "args": {"feature": 1, "fields": {"distance": 15}}}
]
},
{
"title": "A plate's hole widened from 5 to 8 mm",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "hole", "args": {"diameter": 5, "through": true}},
{"tool": "feature_edit", "args": {"feature": 2, "fields": {"hole_diameter": 8}}}
]
}
],
"ids": false
}
},
{
"id": "rename_selected",
"name": "Rename…",
"section": "Menu items",
"slot": "top",
"key": "F2",
"feature": "Tree",
"mode": "model",
"accepts": [
"sk_loop",
"body_solid"
],
"needs": {},
"refusal": "Select a feature, or a body, to rename it",
"gui": true,
"action": "btn:rename",
"icon": "rename_edit",
"hint": "Give this feature a name you will recognise in the tree (a body takes its name from the feature that makes it)",
"feature_row": true
},
{
"id": "delete_face",
"name": "Delete Face",
"section": "Solid",
"slot": "modify",
"key": null,
"feature": "DeleteFace",
"accepts": [
"face_planar",
"face_cyl",
"face_other"
],
"needs": {
"bodies": 1
},
"refusal": "Delete Face needs a body — add or import one first",
"gui": true,
"action": "fly:dressup#3",
"icon": "design_delete",
"hint": "Remove faces from a body and heal the solid",
"tool": {
"access": "change",
"ok_false": true,
"summary": "Remove faces from a solid, healing the gap via OCCT defeaturing.",
"details": "",
"params": [
{"name": "body", "type": "integer", "default": -1, "description": "target body; omit for the last body"},
{"name": "faces", "type": "array", "description": "global face ids to delete"}
],
"examples": [
{
"title": "A plate's bore filled in by deleting its cylindrical face",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "hole", "args": {"diameter": 5, "through": true}},
{"tool": "body_describe", "args": {"body": 0, "kinds": ["cylindrical"]}},
{"tool": "delete_face", "args": {"body": 0, "faces": [6], "generation": {"from_call": 2, "key": "generation"}}}
]
}
],
"ids": true
}
},
{
"id": "colour",
"name": "Color",
"slot": "top",
"key": null,
"feature": null,
"accepts": [
"body_solid",
"body_sheet",
"face_planar",
"face_cyl",
"face_other",
"edge_str",
"edge_circ",
"vertex"
],
"needs": {
"bodies": 1
},
"refusal": null,
"gui": true,
"action": "btn:colour",
"icon": "color_palette",
"hint": "Set the selected body's display color",
"modal": true,
"fold": {"into": "body_set", "args": {}}
},
{
"id": "zoom_to_selection",
"name": "Zoom to selection",
"section": "Menu items",
"slot": "top",
"key": null,
"feature": null,
"mode": "model",
"accepts": [
"body_solid",
"body_sheet",
"face_planar",
"face_cyl",
"face_other",
"edge_str",
"edge_circ",
"vertex",
"sk_loop"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "btn:zoom_to",
"icon": "design_zoom",
"hint": "Frame the selection in the view, keeping the view direction"
},
{
"id": "feature_delete",
"name": "Delete",
"section": "History",
"slot": "modify",
"key": "Del",
"feature": null,
"accepts": [
"sk_loop",
"art",
"datum_plane",
"datum_axis",
"coordsys",
"sk_line",
"sk_arc",
"sk_point",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "btn:delete",
"icon": "design_delete",
"hint": "Delete what is selected",
"feature_row": true,
"tool": {
"access": "change",
"ok_false": false,
"summary": "Delete a feature as its tree row's Delete does; deleting a sketch also deletes the features built on it.",
"details": "One undo step. Later indices shift. Reply: removed (how many features went), features, bodies.",
"params": [
{"name": "feature", "type": "integer", "description": "feature index (describe_design)"}
],
"examples": [
{
"title": "A plate's hole deleted",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "hole", "args": {"diameter": 5, "through": true}},
{"tool": "feature_delete", "args": {"feature": 2}}
]
},
{
"title": "A committed sketch deleted, and the extrude built on it with it",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"p0": [-15, -10], "p1": [15, 10], "type": "rectangle_2_point"}},
{"tool": "sketch_finish", "args": {}},
{"tool": "extrude", "args": {"distance": 5, "sketch": 0}},
{"tool": "feature_delete", "args": {"feature": 0}}
]
}
],
"ids": false
}
},
{
"id": "body_delete",
"name": "Delete Body",
"section": "Bodies",
"slot": "modify",
"key": null,
"action": "btn:delete_body",
"refusal": null,
"accepts": [
"body_solid",
"body_sheet",
"face_planar",
"face_cyl",
"face_other",
"edge_str",
"edge_circ",
"vertex"
],
"needs": {
"bodies": 1
},
"mode": "model",
"family": null,
"icon": "design_delete",
"hint": "Delete this whole body — removes the feature it was made from",
"tool": {
"access": "change",
"ok_false": false,
"summary": "Delete a body as its row's Delete does: the feature that made it goes, which can take other features and bodies with it.",
"details": "One undo step. Reply: deleted_feature {index, type, name}, removed, features, bodies.",
"params": [
{"name": "body", "type": "integer", "description": "body index (describe_design)"}
],
"examples": [
{
"title": "The second of two bodies deleted, with the extrude that made it",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "extrude", "args": {"distance": 10, "operation": "new_body", "profile": [[20, -5], [30, -5], [30, 5], [20, 5]]}},
{"tool": "body_delete", "args": {"body": 1}}
]
}
],
"ids": false
}
},
{
"id": "sk_line_t",
"name": "Line",
"slot": "create",
"key": "L",
"feature": "Sketch",
"mode": "sketch",
"accepts": [
"sk_none",
"sk_point",
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "key:L",
"family": "Line",
"icon": "design_line",
"hint": "Line — click start, then end",
"fold": {"into": "sketch_draw", "args": {"type": "line"}}
},
{
"id": "sk_polyline",
"name": "Polyline",
"slot": "create",
"key": null,
"feature": "Sketch",
"accepts": [
"sk_none",
"sk_point",
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "fly:design_line#1",
"mode": "sketch",
"family": "Line",
"icon": "design_polyline",
"hint": "Click points; click the first point to close the loop, right-click to end it open",
"fold": {"into": "sketch_draw", "args": {"type": "polyline"}}
},
{
"id": "sk_rect",
"name": "Corner rectangle",
"slot": "create",
"key": "R",
"feature": "Sketch",
"mode": "sketch",
"accepts": [
"sk_none",
"sk_point",
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "key:R",
"family": "Rectangle",
"icon": "design_rect",
"hint": "Rectangle — click two opposite corners",
"fold": {"into": "sketch_draw", "args": {"type": "rectangle_2_point"}}
},
{
"id": "sk_rect_center",
"name": "Center rectangle",
"slot": "create",
"key": null,
"feature": "Sketch",
"accepts": [
"sk_none",
"sk_point",
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "fly:design_rect#1",
"mode": "sketch",
"family": "Rectangle",
"icon": "design_crect",
"hint": "Click center, then a corner",
"fold": {"into": "sketch_draw", "args": {"type": "rectangle_center"}}
},
{
"id": "sk_rect_oblique",
"name": "Oblique rectangle",
"slot": "create",
"key": null,
"feature": "Sketch",
"accepts": [
"sk_none",
"sk_point",
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "fly:design_rect#2",
"mode": "sketch",
"family": "Rectangle",
"icon": "design_rect_oblique",
"hint": "Click two corners of one edge, then a point for the width",
"fold": {"into": "sketch_draw", "args": {"type": "rectangle_3_point"}}
},
{
"id": "sk_rect_rounded",
"name": "Rounded rectangle",
"slot": "create",
"key": null,
"feature": "Sketch",
"accepts": [
"sk_none",
"sk_point",
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "fly:design_rect#3",
"mode": "sketch",
"family": "Rectangle",
"icon": "design_rect_rounded",
"hint": "Click two opposite corners, then a point for the corner radius",
"fold": {"into": "sketch_draw", "args": {"type": "rectangle_rounded"}}
},
{
"id": "sk_circle",
"name": "Center circle",
"slot": "create",
"key": "C",
"feature": "Sketch",
"mode": "sketch",
"accepts": [
"sk_none",
"sk_point",
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "key:C",
"family": "Circle",
"icon": "design_circle",
"hint": "Circle — click center, then radius",
"fold": {"into": "sketch_draw", "args": {"type": "circle_center"}}
},
{
"id": "sk_circle_2pt",
"name": "2-point circle",
"slot": "create",
"key": null,
"feature": "Sketch",
"accepts": [
"sk_none",
"sk_point",
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "fly:design_circle#1",
"mode": "sketch",
"family": "Circle",
"icon": "design_circle2pt",
"hint": "Click two ends of the diameter",
"fold": {"into": "sketch_draw", "args": {"type": "circle_2_point"}}
},
{
"id": "sk_circle_3pt",
"name": "3-point circle",
"slot": "create",
"key": null,
"feature": "Sketch",
"accepts": [
"sk_none",
"sk_point",
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "fly:design_circle#2",
"mode": "sketch",
"family": "Circle",
"icon": "design_circle3pt",
"hint": "Click three points on the circle",
"fold": {"into": "sketch_draw", "args": {"type": "circle_3_point"}}
},
{
"id": "sk_arc_t",
"name": "3-point arc",
"slot": "create",
"key": "A",
"feature": "Sketch",
"mode": "sketch",
"accepts": [
"sk_none",
"sk_point",
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "key:A",
"family": "Arc",
"icon": "design_arc3pt",
"hint": "Arc — click start, end, then a point",
"fold": {"into": "sketch_draw", "args": {"type": "arc_3_point"}}
},
{
"id": "sk_arc_tangent",
"name": "Tangent arc",
"slot": "create",
"key": null,
"feature": "Sketch",
"accepts": [
"sk_none",
"sk_point",
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "fly:design_arc3pt#1",
"mode": "sketch",
"family": "Arc",
"icon": "design_tangentarc",
"hint": "Click start (on the last entity) then end",
"fold": {"into": "sketch_draw", "args": {"type": "arc_tangent"}}
},
{
"id": "sk_arc_center",
"name": "Center-point arc",
"slot": "create",
"key": null,
"feature": "Sketch",
"accepts": [
"sk_none",
"sk_point",
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "fly:design_arc3pt#2",
"mode": "sketch",
"family": "Arc",
"icon": "design_arc_center",
"hint": "Click center, then start, then a point for the end angle",
"fold": {"into": "sketch_draw", "args": {"type": "arc_center"}}
},
{
"id": "sk_slot",
"name": "Slot",
"slot": "create",
"key": "S",
"feature": "Sketch",
"mode": "sketch",
"accepts": [
"sk_none",
"sk_point",
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "key:S",
"family": "Slot",
"icon": "design_slot",
"hint": "Slot — two centerline ends, then the width",
"fold": {"into": "sketch_draw", "args": {"type": "slot"}}
},
{
"id": "sk_slot_arc",
"name": "Arc slot",
"slot": "create",
"key": null,
"feature": "Sketch",
"accepts": [
"sk_none",
"sk_point",
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "fly:design_slot#1",
"mode": "sketch",
"family": "Slot",
"icon": "design_slot_arc",
"hint": "Click center, start, end, then a point for the width",
"fold": {"into": "sketch_draw", "args": {"type": "slot_arc"}}
},
{
"id": "sk_ellipse",
"name": "Ellipse",
"slot": "create",
"key": "E",
"feature": "Sketch",
"mode": "sketch",
"accepts": [
"sk_none",
"sk_point",
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "key:E",
"family": "Ellipse",
"icon": "design_ellipse",
"hint": "Ellipse — center, major end, minor point",
"fold": {"into": "sketch_draw", "args": {"type": "ellipse"}}
},
{
"id": "sk_ellipse_arc",
"name": "Elliptical arc",
"slot": "create",
"key": null,
"feature": "Sketch",
"accepts": [
"sk_none",
"sk_point",
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "fly:design_ellipse#1",
"mode": "sketch",
"family": "Ellipse",
"icon": "design_ellipse_arc",
"hint": "Click center, major-axis end, minor point, then arc start and end",
"fold": {"into": "sketch_draw", "args": {"type": "ellipse_arc"}}
},
{
"id": "sk_spline",
"name": "Spline",
"slot": "create",
"key": "B",
"feature": "Sketch",
"mode": "sketch",
"accepts": [
"sk_none",
"sk_point",
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "key:B",
"icon": "design_bspline",
"hint": "Spline — click control points",
"fold": {"into": "sketch_draw", "args": {"type": "spline"}}
},
{
"id": "sk_poly_3",
"name": "Triangle",
"slot": "create",
"key": null,
"feature": "Sketch",
"accepts": [
"sk_none",
"sk_point",
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "btn:poly#3",
"mode": "sketch",
"family": "Polygon",
"icon": "design_polygon",
"hint": "Triangle — click center, then a vertex",
"fold": {"into": "sketch_draw", "args": {"type": "polygon", "sides": 3}}
},
{
"id": "sk_poly_4",
"name": "Square",
"slot": "create",
"key": null,
"feature": "Sketch",
"accepts": [
"sk_none",
"sk_point",
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "btn:poly#4",
"mode": "sketch",
"family": "Polygon",
"icon": "design_polygon",
"hint": "Square — click center, then a vertex",
"fold": {"into": "sketch_draw", "args": {"type": "polygon", "sides": 4}}
},
{
"id": "sk_poly_5",
"name": "Pentagon",
"slot": "create",
"key": null,
"feature": "Sketch",
"accepts": [
"sk_none",
"sk_point",
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "btn:poly#5",
"mode": "sketch",
"family": "Polygon",
"icon": "design_polygon",
"hint": "Pentagon — click center, then a vertex",
"fold": {"into": "sketch_draw", "args": {"type": "polygon", "sides": 5}}
},
{
"id": "sk_polygon",
"name": "Hexagon",
"slot": "create",
"key": "G",
"feature": "Sketch",
"mode": "sketch",
"accepts": [
"sk_none",
"sk_point",
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "btn:poly#6",
"family": "Polygon",
"icon": "design_polygon",
"hint": "Hexagon — click center, then a vertex",
"fold": {"into": "sketch_draw", "args": {"type": "polygon", "sides": 6}}
},
{
"id": "sk_poly_8",
"name": "Octagon",
"slot": "create",
"key": null,
"feature": "Sketch",
"accepts": [
"sk_none",
"sk_point",
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "btn:poly#8",
"mode": "sketch",
"family": "Polygon",
"icon": "design_polygon",
"hint": "Octagon — click center, then a vertex",
"fold": {"into": "sketch_draw", "args": {"type": "polygon", "sides": 8}}
},
{
"id": "sk_poly_12",
"name": "Dodecagon",
"slot": "create",
"key": null,
"feature": "Sketch",
"accepts": [
"sk_none",
"sk_point",
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "btn:poly#12",
"mode": "sketch",
"family": "Polygon",
"icon": "design_polygon",
"hint": "Dodecagon — click center, then a vertex",
"fold": {"into": "sketch_draw", "args": {"type": "polygon", "sides": 12}}
},
{
"id": "sketch_polygon_inscribed",
"name": "Inscribed",
"section": "Menu items",
"slot": "create",
"key": null,
"feature": "Sketch",
"accepts": [
"sk_none",
"sk_point",
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "btn:polyfit#0",
"mode": "sketch",
"family": "Polygon",
"icon": "design_polygon",
"hint": "Measure the polygon to its corners (inscribed)"
},
{
"id": "sketch_polygon_circumscribed",
"name": "Circumscribed",
"section": "Menu items",
"slot": "create",
"key": null,
"feature": "Sketch",
"accepts": [
"sk_none",
"sk_point",
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "btn:polyfit#1",
"mode": "sketch",
"family": "Polygon",
"icon": "design_polygon",
"hint": "Measure the polygon to its flats (circumscribed)"
},
{
"id": "sk_point_t",
"name": "Point",
"slot": "create",
"key": "P",
"feature": "Sketch",
"mode": "sketch",
"accepts": [
"sk_none",
"sk_point",
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "key:P",
"icon": "design_point",
"hint": "Point — click to place",
"fold": {"into": "sketch_draw", "args": {"type": "point"}}
},
{
"id": "sketch_text",
"name": "Text",
"section": "Sketch",
"slot": "create",
"key": null,
"feature": "Sketch",
"accepts": [
"sk_none",
"sk_point",
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "btn:text",
"mode": "sketch",
"icon": "design_text",
"hint": "Type text; it becomes a Text feature on this sketch's plane, editable later",
"modal": true,
"tool": {
"access": "change",
"ok_false": false,
"summary": "Add text as a Text feature on a plane or a planar face, outlined in a font, as the Text dialog adds it.",
"details": "It runs on the model, in one undo step, with no dialog and no placement step, and is refused while a sketch is open. Refused for a font that is not installed or cannot be loaded, and for text with no outline (spaces only). The feature keeps its words, font and height, as the dialog's does. Reply: text_index, bodies, frame (the plane's).",
"params": [
{"name": "text", "type": "string", "description": "the words"},
{"name": "font", "type": "string", "default": "", "description": "a font face, as the Text dialog's Font list names it; left out or empty, the face last used"},
{"name": "bold", "type": "boolean", "default": false, "description": "the face's bold"},
{"name": "italic", "type": "boolean", "default": false, "description": "the face's italic"},
{"name": "height", "type": "number", "unit": "mm", "default": null, "min": 0.5, "max": 500, "description": "the text's height; left out, the height last used (10 mm at first)"},
{"name": "plane", "type": "string|object", "default": "XY", "description": "\"XY\", \"XZ\" or \"YZ\" through modeling_origin; {\"datum\": i}, a Plane feature; or {\"body\": b, \"face\": f}, a planar face, whose centre the text is centred on. The reply's frame gives the axes."},
{"name": "position", "type": "array", "default": [0, 0], "description": "[x, y] in the plane, mm: where the text's centre goes"}
],
"examples": [
{
"title": "The word Orca, 12 mm high, on the XY plane",
"calls": [
{"tool": "sketch_text", "args": {"height": 12, "text": "Orca"}}
]
},
{
"title": "A label centred on a plate's top face",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "body_describe", "args": {"at_extreme": "+z", "body": 0}},
{"tool": "sketch_text", "args": {"generation": {"from_call": 1, "key": "generation"}, "height": 6, "plane": {"body": 0, "face": 5}, "text": "A1"}}
]
}
],
"ids": true
}
},
{
"id": "sketch_insert_svg",
"name": "SVG",
"section": "Sketch",
"slot": "create",
"key": null,
"feature": "Sketch",
"accepts": [
"sk_none",
"sk_point",
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "btn:svg",
"mode": "sketch",
"icon": "design_svg",
"hint": "Import an SVG outline into this sketch as editable lines",
"modal": true,
"tool": {
"access": "sketch",
"ok_false": false,
"summary": "Add an SVG file's filled outlines to the open sketch as lines, or to the model as art on a plane.",
"details": "The outlines are centred on the plane's origin, scaled by scale and moved by position, with no file dialog and no placement step. With a sketch open, a new one or one re-opened with sketch_edit, they are added to it as lines, as Insert SVG adds them there, and plane is refused; reply: scope \"sketch\", added, entities (how many the sketch has). With none open, an art feature on plane, as Insert SVG adds one on the model, in one undo step; reply: art_index, bodies, frame (the plane's). Refused when the file is not there or gives no outline (no filled shape).",
"params": [
{"name": "path", "type": "string", "description": "absolute path of the .svg file"},
{"name": "scale", "type": "number", "default": 1, "exclusive_min": 0, "description": "times the size the file gives"},
{"name": "position", "type": "array", "default": [0, 0], "description": "[x, y] in the plane, mm: where the outlines' centre goes"},
{"name": "plane", "type": "string|object", "default": null, "description": "with no sketch open, the art's plane: \"XY\" (left out or null), \"XZ\" or \"YZ\" through modeling_origin; {\"datum\": i}, a Plane feature; or {\"body\": b, \"face\": f}, a planar face, whose centre is the origin. The reply's frame gives the axes. With a sketch open, refused: the outlines go on its plane."}
],
"examples": [
{
"title": "A logo placed on the XY plane as art, its centre 10 mm right of the origin",
"calls": [
{"tool": "sketch_insert_svg", "args": {"path": "/path/to/logo.svg", "position": [10, 0]}}
],
"needs": "an SVG file with a filled shape"
},
{
"title": "A logo's outlines drawn into an open sketch at half size",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_insert_svg", "args": {"path": "/path/to/logo.svg", "scale": 0.5}}
],
"needs": "an SVG file with a filled shape"
}
],
"ids": true
}
},
{
"id": "sketch_offset",
"name": "Offset",
"section": "Sketch",
"slot": "add",
"key": "O",
"feature": "Sketch",
"mode": "sketch",
"accepts": [
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "key:O",
"icon": "design_offset",
"hint": "Offset — pick an entity, drag the distance",
"tool": {
"access": "sketch",
"ok_false": false,
"summary": "Add an offset copy of sketch lines, arcs and circles.",
"details": "The copy of one entity alone is bound to it, Parallel for a line and Concentric for an arc or a circle, as the Offset tool binds it. Reply: first_index, added, constraints_added (that binding, as sketch_list_constraints writes it), dof.",
"params": [
{"name": "distance", "type": "number", "unit": "mm", "description": "signed offset"},
{"name": "entities", "type": "array", "default": [], "description": "entity indices; omit for the selection, else every entity"}
],
"examples": [
{
"title": "A rectangle's 2 mm inner wall",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"p0": [-15, -10], "p1": [15, 10], "type": "rectangle_2_point"}},
{"tool": "sketch_offset", "args": {"distance": 2}}
]
},
{
"title": "A circle grown 2 mm by a negative offset",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"entities": [{"center": [0, 0], "radius": 5, "type": "circle_center"}]}},
{"tool": "sketch_offset", "args": {"distance": -2, "entities": [0]}}
]
}
],
"ids": false
}
},
{
"id": "sketch_trim",
"name": "Trim",
"section": "Sketch",
"slot": "remove",
"key": "T",
"feature": "Sketch",
"mode": "sketch",
"accepts": [
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "key:T",
"icon": "design_trim",
"hint": "Trim — click a segment to trim it",
"tool": {
"access": "sketch",
"ok_false": false,
"summary": "Trim the open sketch's entity nearest `at`, as a Trim click there does.",
"details": "A line or an arc is cut back from its end nearer `at` to the first crossing with another entity beyond `at`; a circle loses the part between the crossings either side of `at` and becomes an arc. The entity's constraints are released. Reply: entity, geometry (its new fields), released_constraints, entities, dof.",
"params": [
{"name": "at", "type": "array", "description": "[x, y] in the sketch plane, mm: a point on the part to cut"},
{"name": "tolerance", "type": "number", "unit": "mm", "default": 0.05, "description": "how far from `at` the entity may be"}
],
"examples": [
{
"title": "A line cut back to the line crossing it",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"entities": [{"p0": [-10, 0], "p1": [10, 0], "type": "line"}, {"p0": [0, -5], "p1": [0, 5], "type": "line"}]}},
{"tool": "sketch_trim", "args": {"at": [5, 0]}}
]
}
],
"ids": false
}
},
{
"id": "sketch_fillet",
"name": "Fillet",
"section": "Sketch",
"slot": "dressup",
"key": "F",
"feature": "Sketch",
"mode": "sketch",
"accepts": [
"sk_line",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "key:F",
"icon": "design_filletedge",
"hint": "Fillet — pick two lines, set the radius",
"tool": {
"access": "sketch",
"ok_false": false,
"summary": "Round the corner of two lines of the open sketch, as the Fillet tool does.",
"details": "Both lines are cut back and joined by an arc of `radius`, bound coincident and tangent to them; constraints the sharp corner held are released. Reply: entity (the arc), lines, released_constraints, entities, constraints, dof, solve_ok.",
"params": [
{"name": "entities", "type": "array", "default": [], "description": "the two line indices; omit for the selection"},
{"name": "radius", "type": "number", "unit": "mm"}
],
"examples": [
{
"title": "A rectangle's corner rounded to 3 mm",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"p0": [-15, -10], "p1": [15, 10], "type": "rectangle_2_point"}},
{"tool": "sketch_fillet", "args": {"entities": [0, 1], "radius": 3}}
]
}
],
"ids": false
}
},
{
"id": "sketch_chamfer",
"name": "Chamfer",
"section": "Sketch",
"slot": "dressup",
"key": "H",
"feature": "Sketch",
"mode": "sketch",
"accepts": [
"sk_line",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "key:H",
"icon": "design_chamfer",
"hint": "Chamfer — pick two lines, set the distance",
"tool": {
"access": "sketch",
"ok_false": false,
"summary": "Bevel the corner of two lines of the open sketch, as the Chamfer tool does.",
"details": "Both lines are cut back by `distance` from the corner and joined by a line bound coincident to them. Reply: entity (the new line), lines, released_constraints, entities, constraints, dof, solve_ok.",
"params": [
{"name": "entities", "type": "array", "default": [], "description": "the two line indices; omit for the selection"},
{"name": "distance", "type": "number", "unit": "mm", "description": "setback along each line"}
],
"examples": [
{
"title": "A rectangle's corner bevelled 2 mm back",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"p0": [-15, -10], "p1": [15, 10], "type": "rectangle_2_point"}},
{"tool": "sketch_chamfer", "args": {"distance": 2, "entities": [1, 2]}}
]
}
],
"ids": false
}
},
{
"id": "sk_array",
"name": "Linear array",
"slot": "repeat",
"key": null,
"feature": "Sketch",
"accepts": [
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "fly:design_array#0",
"mode": "sketch",
"family": "Array",
"icon": "design_array",
"hint": "Pick entities, drag the spacing handle, click the count; click empty to apply",
"fold": {"into": "sketch_pattern", "args": {"type": "linear"}}
},
{
"id": "sk_array_polar",
"name": "Polar array",
"slot": "repeat",
"key": null,
"feature": "Sketch",
"accepts": [
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "fly:design_array#1",
"mode": "sketch",
"family": "Array",
"icon": "design_polararray",
"hint": "Pick entities, drag the sweep handle, click the count; click empty to apply",
"fold": {"into": "sketch_pattern", "args": {"type": "circular"}}
},
{
"id": "sketch_mirror",
"name": "Mirror",
"section": "Sketch",
"slot": "repeat",
"key": "M",
"feature": "Sketch",
"mode": "sketch",
"accepts": [
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "key:M",
"icon": "design_mirror",
"hint": "Mirror — pick axis, then entities",
"tool": {
"access": "sketch",
"ok_false": false,
"summary": "Add a mirrored copy of sketch entities about a line of the sketch, one of its axes, or the line through two points.",
"details": "About axis, as the Mirror tool's Confirm: each copy is bound Symmetric to its source about the axis, unless that would move anything off its reflection, and constraints_added lists the constraints kept. axis_a and axis_b, two free points, bind nothing, and axis is refused beside either. Reply: first_index, added, constraints_added (as sketch_list_constraints writes them), dof.",
"params": [
{"name": "axis", "type": "integer|string", "default": null, "description": "a line of the sketch by its entity index, \"x_axis\" or \"y_axis\"; omit for axis_a and axis_b"},
{"name": "axis_a", "type": "array", "default": [0, 0], "description": "[x, y] in the sketch plane, mm"},
{"name": "axis_b", "type": "array", "default": [0, 1], "description": "[x, y] in the sketch plane, mm"},
{"name": "entities", "type": "array", "default": [], "description": "entity indices; omit for the selection, else every entity but the axis"}
],
"examples": [
{
"title": "A circle mirrored about the sketch's y axis, its copy bound to it",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"entities": [{"center": [10, 0], "radius": 3, "type": "circle_center"}]}},
{"tool": "sketch_mirror", "args": {"axis": "y_axis"}}
]
},
{
"title": "A line mirrored about a construction line of the sketch",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"entities": [{"p0": [5, 0], "p1": [10, 5], "type": "line"}, {"construction": true, "p0": [20, -10], "p1": [20, 10], "type": "line"}]}},
{"tool": "sketch_mirror", "args": {"axis": 1, "entities": [0]}}
]
},
{
"title": "A circle mirrored across the line through two free points",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"entities": [{"center": [10, 0], "radius": 3, "type": "circle_center"}]}},
{"tool": "sketch_mirror", "args": {"axis_a": [0, 0], "axis_b": [1, 1]}}
]
}
],
"ids": false
}
},
{
"id": "sk_move",
"name": "Move",
"slot": "transform",
"key": null,
"feature": "Sketch",
"mode": "sketch",
"accepts": [
"sk_line",
"sk_arc",
"sk_point",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "fly:design_move#0",
"family": "Move",
"icon": "design_move",
"hint": "Pick entities, then drag the handle or click the distance; click empty to apply",
"fold": {"into": "sketch_transform", "args": {"type": "move"}}
},
{
"id": "sk_rotate",
"name": "Rotate",
"slot": "transform",
"key": null,
"feature": "Sketch",
"accepts": [
"sk_line",
"sk_arc",
"sk_point",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "fly:design_move#1",
"mode": "sketch",
"family": "Move",
"icon": "design_rotate",
"hint": "Pick entities, then drag around the pivot or click the angle; click empty to apply",
"fold": {"into": "sketch_transform", "args": {"type": "rotate"}}
},
{
"id": "sk_scale",
"name": "Scale",
"slot": "transform",
"key": null,
"feature": "Sketch",
"accepts": [
"sk_line",
"sk_arc",
"sk_point",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "fly:design_move#2",
"mode": "sketch",
"family": "Move",
"icon": "design_scale",
"hint": "Pick entities, then drag the handle or click the factor; click empty to apply",
"fold": {"into": "sketch_transform", "args": {"type": "scale"}}
},
{
"id": "sketch_dimension",
"name": "Dimension",
"section": "Sketch",
"slot": "reference",
"key": "D",
"feature": "Sketch",
"mode": "sketch",
"accepts": [
"sk_none",
"sk_line",
"sk_arc",
"sk_point",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "key:D",
"icon": "design_dimension",
"hint": "Dimension — click 2 points or an entity",
"tool": {
"access": "sketch",
"ok_false": false,
"summary": "Add a dimension to the open sketch: a distance, an angle, a radius or a diameter.",
"details": "With `entities`, else the selection, the CONSTRAIN bar's rules choose the points, and the value is `value` or the current one. With `refs` the references are taken as written, as sketch_constrain takes them, and `value` is required. distance has no button and takes refs. A dimension the sketch cannot solve with is rolled back and the call fails. Reply: added (indices), items, constraints, dof, solve_ok.",
"params": [
{"name": "type", "type": "string", "enum": ["distance", "distance_x", "distance_y", "angle", "radius", "diameter"]},
{"name": "entities", "type": "array", "default": [], "description": "1 or 2 entity indices; omit for the selection"},
{"name": "refs", "type": "array", "default": [], "description": "[{entity, role?}], instead of entities"},
{"name": "value", "type": "number", "default": null, "description": "mm, or degrees for an angle"}
],
"examples": [
{
"title": "A line's ends held 25 mm apart, named by refs",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"entities": [{"p0": [0, 0], "p1": [10, 2], "type": "line"}]}},
{"tool": "sketch_dimension", "args": {"refs": [{"entity": 0, "role": "p0"}, {"entity": 0, "role": "p1"}], "type": "distance", "value": 25}}
]
},
{
"title": "A circle's radius set to 5 mm",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"entities": [{"center": [0, 0], "radius": 3, "type": "circle_center"}]}},
{"tool": "sketch_dimension", "args": {"entities": [0], "type": "radius", "value": 5}}
]
}
],
"ids": false
}
},
{
"id": "sketch_constrain",
"name": "Constrain",
"section": "Sketch",
"slot": "reference",
"key": "K",
"feature": "Sketch",
"mode": "sketch",
"accepts": [
"sk_line",
"sk_arc",
"sk_point",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "key:K",
"icon": "design_constrain",
"hint": "Constrain the selected sketch entities to each other",
"tool": {
"access": "sketch",
"ok_false": false,
"summary": "Add a constraint to the open sketch, as a CONSTRAIN bar button does (sketch_set_value is the value field, V).",
"details": "With `entities`, else the selection, the button's own rules choose the points. With `refs` the references are taken as written, in sketch_list_constraints' form: {entity, role} for a point (role p0, p1 or center; entity also \"origin\") and {entity} for a whole entity (also \"x_axis\", \"y_axis\"). lock_x, lock_y, point_on_line and point_on_object have no button and take refs. A distance, an angle, a radius or a diameter is sketch_dimension's. A constraint the sketch cannot solve with is rolled back and the call fails. Reply: added (indices), items, constraints, dof, solve_ok.",
"params": [
{"name": "type", "type": "string", "enum": ["fix", "coincident", "horizontal", "vertical", "lock_x", "lock_y", "equal_length", "parallel", "perpendicular", "concentric", "tangent", "midpoint", "symmetric", "point_on_line", "point_on_object", "equal_radius", "collinear", "symmetric_about_y", "symmetric_about_x", "equal"], "description": "\"equal\" is the Equal button: equal length, or equal radius for two curves"},
{"name": "entities", "type": "array", "default": [], "description": "1 to 3 entity indices; omit for the selection"},
{"name": "refs", "type": "array", "default": [], "description": "[{entity, role?}], instead of entities"},
{"name": "value", "type": "number", "default": null, "description": "mm: the coordinate lock_x and lock_y hold, or point_on_line's distance from the line; the other types take none"}
],
"examples": [
{
"title": "A sloping line made horizontal",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"entities": [{"p0": [0, 0], "p1": [10, 2], "type": "line"}]}},
{"tool": "sketch_constrain", "args": {"entities": [0], "type": "horizontal"}}
]
},
{
"title": "Two circles given equal radii",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"entities": [{"center": [0, 0], "radius": 4, "type": "circle_center"}, {"center": [15, 0], "radius": 6, "type": "circle_center"}]}},
{"tool": "sketch_constrain", "args": {"entities": [0, 1], "type": "equal"}}
]
},
{
"title": "A line's start held at x = 5, named by refs",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"entities": [{"p0": [0, 0], "p1": [10, 2], "type": "line"}]}},
{"tool": "sketch_constrain", "args": {"refs": [{"entity": 0, "role": "p0"}], "type": "lock_x", "value": 5}}
]
}
],
"ids": false
}
},
{
"id": "sketch_constrain_selected",
"name": "Constrain sketch",
"section": "Menu items",
"slot": "reference",
"key": null,
"feature": "Sketch",
"mode": "model",
"accepts": [
"sk_loop"
],
"needs": {
"sketches": 1
},
"refusal": "Select a sketch to constrain it",
"gui": true,
"action": "btn:constrain",
"icon": "design_constrain",
"hint": "Add dimensions and relations (coincident, tangent, parallel...) to the selected sketch",
"feature_row": true,
"note": [
"Same verb, model-mode vocabulary: offered when a SKETCH is selected (bit 14, SkLoop), the",
"state a user is in right after finishing one. Without this item the only way in was the",
"toolbar icon, and constraints read as absent — see the Onshape-comparison report.",
"It sits in the Reference row, the address the sketch-mode Constrain has: one verb, one row."
]
},
{
"id": "sketch_toggle_construction",
"name": "Construction",
"section": "Sketch",
"slot": "reference",
"key": "Q",
"feature": "Sketch",
"mode": "sketch",
"accepts": [
"sk_none",
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "key:Q",
"icon": "design_construction",
"hint": "Toggle construction: geometry that guides but is never built",
"tool": {
"access": "sketch",
"ok_false": false,
"summary": "Toggle construction on sketch entities.",
"details": "Reply: changed, how many, and ok, false when none did.",
"params": [
{"name": "entities", "type": "array", "default": [], "description": "entity indices; omit for the selection"}
],
"examples": [
{
"title": "A centre line across a rectangle, made construction so it splits no loop",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"p0": [-15, -10], "p1": [15, 10], "type": "rectangle_2_point"}},
{"tool": "sketch_draw", "args": {"entities": [{"p0": [0, -10], "p1": [0, 10], "type": "line"}]}},
{"tool": "sketch_toggle_construction", "args": {"entities": [4]}}
]
}
],
"ids": false
}
},
{
"id": "sketch_extend",
"name": "Extend",
"section": "Sketch",
"slot": "modify",
"key": "X",
"feature": "Sketch",
"mode": "sketch",
"accepts": [
"sk_line",
"sk_arc",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "key:X",
"icon": "design_extend",
"hint": "Extend — click a line/arc to extend it",
"tool": {
"access": "sketch",
"ok_false": false,
"summary": "Extend the open sketch's line or arc nearest `at` to the next entity, as an Extend click there does.",
"details": "The line's or arc's end nearer `at` runs out to the first entity it meets. The entity's constraints are released. Reply: entity, geometry (its new fields), released_constraints, entities, dof.",
"params": [
{"name": "at", "type": "array", "description": "[x, y] in the sketch plane, mm: near the end to extend"},
{"name": "tolerance", "type": "number", "unit": "mm", "default": 0.05, "description": "how far from `at` the entity may be"}
],
"examples": [
{
"title": "A line extended down to the line below it",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"entities": [{"p0": [-10, 0], "p1": [10, 0], "type": "line"}, {"p0": [0, 3], "p1": [0, 8], "type": "line"}]}},
{"tool": "sketch_extend", "args": {"at": [0, 3]}}
]
}
],
"ids": false
}
},
{
"id": "sketch_delete",
"name": "Delete",
"section": "Sketch",
"slot": "modify",
"key": "Del",
"feature": "Sketch",
"mode": "sketch",
"accepts": [
"sk_line",
"sk_arc",
"sk_point",
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "btn:sk_delete",
"icon": "design_delete",
"hint": "Delete the selected sketch entities",
"tool": {
"access": "sketch",
"ok_false": false,
"summary": "Delete sketch entities.",
"details": "Reply: removed, entities.",
"params": [
{"name": "entities", "type": "array", "default": [], "description": "entity indices; omit for the selection"}
],
"examples": [
{
"title": "Delete a rectangle's top side",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"p0": [-15, -10], "p1": [15, 10], "type": "rectangle_2_point"}},
{"tool": "sketch_delete", "args": {"entities": [2]}}
]
},
{
"title": "Delete the selected sides",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"p0": [-15, -10], "p1": [15, 10], "type": "rectangle_2_point"}},
{"tool": "sketch_select", "args": {"entities": [1, 3]}},
{"tool": "sketch_delete", "args": {"silent": true}}
]
}
],
"ids": false
}
},
{
"id": "sk_length",
"name": "Length…",
"slot": "modify",
"key": "V",
"feature": "Sketch",
"mode": "sketch",
"accepts": [
"sk_line"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "key:V",
"icon": "design_dimension",
"hint": "Type the length of this line",
"note": [
"Typing the defining number of the element you pointed at. Three items rather than one so",
"each names the quantity in the drawing-office word for THAT element; all three land on",
"the same handler, because dimension_kind() already resolves the quantity from the",
"selection. Without these, an element's own numbers were reachable only by arming the",
"Dimension tool and re-picking geometry that was already selected."
],
"fold": {"into": "sketch_set_value", "args": {}}
},
{
"id": "sk_radius",
"name": "Radius / diameter…",
"slot": "modify",
"key": "V",
"feature": "Sketch",
"mode": "sketch",
"accepts": [
"sk_arc"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "key:V",
"icon": "design_dimension",
"hint": "Type the radius of this arc, or the diameter of this circle",
"fold": {"into": "sketch_set_value", "args": {}}
},
{
"id": "sk_angdist",
"name": "Angle / distance…",
"slot": "modify",
"key": "V",
"feature": "Sketch",
"mode": "sketch",
"accepts": [
"sk_2ent"
],
"needs": {},
"refusal": null,
"gui": true,
"action": "key:V",
"icon": "design_dimension",
"hint": "Type the angle between two lines, or the distance between the two picks",
"fold": {"into": "sketch_set_value", "args": {}}
},
{
"id": "describe_design",
"name": "Describe design",
"section": "Document",
"slot": null,
"action": null,
"gui": false,
"tool": {
"access": "read",
"ok_false": false,
"summary": "The Design document: features, variables with their values, bodies, undo_depth / redo_depth and generation.",
"details": "A feature's bound lists the fields an expression drives; a body gives bbox, where the model has it, source_feature, visible, color, moved, and placement: where the body stands for Commit to Plate and Export STEP (body_place, the Move gizmo, Place on Face), null where the model has it, else three rows of four numbers, the rotation and the translation in mm, in the world frame. commit_mode is the Commit button's mode, assembly or bodies, which commit_to_plate uses when given none. selection is what the right-click menu would be built for: its kind, the selection_kind a tool's opening reply gives, and its id (none, face_planar, body_solid, sk_line and the like). picked_plane is the reference plane picked in the view (XY, XZ, YZ), which the next Sketch opens on, and feature_row the selected row of the Feature list, a feature index; each is null when there is none.",
"params": [],
"examples": [
{
"title": "An empty design",
"calls": [
{"tool": "describe_design", "args": {}}
]
},
{
"title": "A plate's two features and its body",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "describe_design", "args": {}}
]
}
],
"ids": false
}
},
{
"id": "feature_describe",
"name": "Feature describe",
"section": "History",
"slot": null,
"action": null,
"gui": false,
"tool": {
"access": "read",
"ok_false": false,
"summary": "One feature as its card shows it: params, the editable ones with their ranges, expr, refs, used_by and bodies_made.",
"details": "expr holds its bindings, and refs the feature and body indices and face and edge ids it uses, those feature_edit's refs takes; ids_of says which model those body indices and ids are read in: \"before\", the model just before the feature, whose bodies bodies_before lists ({index, name}) and body_describe {before: feature} reads, or \"finished\" for a Plane, an Axis and a CoordSys, read with body_describe without before. A sketch adds its plane, entities and constraints (angles in degrees). Imported Text or SVG art shows its regions (a count), region_loops (how many closed loops each region has, its outer loop plus its holes; counts, not the loops' geometry) and region_areas (each region's filled area in mm² as placed, its outer loop less its holes).",
"params": [
{"name": "feature", "type": "integer", "description": "feature index (describe_design)"}
],
"examples": [
{
"title": "A plate's extrude, with the fields its card edits",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "feature_describe", "args": {"feature": 1}}
]
},
{
"title": "A committed sketch's plane, entities and constraints",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"p0": [-15, -10], "p1": [15, 10], "type": "rectangle_2_point"}},
{"tool": "sketch_finish", "args": {}},
{"tool": "feature_describe", "args": {"feature": 0}}
]
}
],
"ids": true
}
},
{
"id": "body_describe",
"name": "Body describe",
"section": "Inspect",
"slot": null,
"action": null,
"gui": false,
"tool": {
"access": "read",
"ok_false": false,
"summary": "A body's faces and edges, with their kinds and geometry, narrowed by face and edge filters.",
"details": "Faces give kind, area, centroid, normal, and a cylinder's, cone's, sphere's or torus's numbers; edges give kind, length, ends, a circle's centre and radius. Face filters (kinds, direction, at_extreme) and edge filters (edge_kinds, direction, convex) narrow their own list; when filters are given, a list none of its filters names is empty, or with adjacency holds the neighbours of the other list. Reply: face_count and edge_count of the body, faces_total and edges_total after filtering, next_offset while a page has more, generation.",
"params": [
{"name": "body", "type": "integer", "default": 0},
{"name": "kinds", "type": "array", "default": null, "description": "face kinds to list: planar, cylindrical, conical, spherical, toroidal, bezier, bspline, revolution, extrusion, offset, other"},
{"name": "edge_kinds", "type": "array", "default": null, "description": "edge kinds to list: line, circle, ellipse, bspline, bezier, other"},
{"name": "direction", "type": "array", "default": null, "description": "[x, y, z]: planar faces whose outward normal points this way, and line edges along it either way, within 1 degree"},
{"name": "at_extreme", "type": "string", "default": null, "enum": ["+x", "-x", "+y", "-y", "+z", "-z"], "description": "faces whose centroid lies on that side of the body's bounding box, e.g. +z for the top face"},
{"name": "convex", "type": "boolean", "default": null, "description": "edges where two faces meet in an outside (true) or inside (false) corner; implies adjacency"},
{"name": "adjacency", "type": "boolean", "default": false, "description": "faces list their edges; edges list their faces (one for a seam) and say convex true or false, or tangent where the faces meet smoothly"},
{"name": "limit", "type": "integer", "default": null, "min": 1, "description": "page size of both lists; omit for all"},
{"name": "offset", "type": "integer", "default": 0},
{"name": "vertices", "type": "boolean", "default": false, "description": "also list every vertex of the body as vertices [{id, p}], unfiltered and unpaged"},
{"name": "before", "type": "integer", "default": null, "description": "a feature index: the body as it stood just before that feature, whose ids are the ones feature_edit's refs takes for it; the reply says before, and its generation is the design's"}
],
"examples": [
{
"title": "Every face and edge of a 20 x 20 x 5 mm plate",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "body_describe", "args": {"body": 0}}
]
},
{
"title": "A plate's top face",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "body_describe", "args": {"at_extreme": "+z", "body": 0}}
]
},
{
"title": "A plate's vertical outside corners, the edges a fillet rounds",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "body_describe", "args": {"body": 0, "convex": true, "direction": [0, 0, 1], "edge_kinds": ["line"]}}
]
}
],
"ids": true
}
},
{
"id": "body_section",
"name": "Body section",
"section": "Inspect",
"slot": null,
"action": null,
"gui": false,
"tool": {
"access": "read",
"ok_false": false,
"summary": "Cross-section of a body by a base plane at an offset (sections-as-evidence).",
"details": "Returns ordered world contours, each flagged closed/open.",
"params": [
{"name": "body", "type": "integer", "default": 0},
{"name": "plane", "type": "string", "default": "XY", "enum": ["XY", "XZ", "YZ"], "description": "the base plane through the world origin, not through modeling_origin as the other commands' planes are"},
{"name": "offset", "type": "number", "unit": "mm", "default": 0, "description": "along the plane's normal, from the world origin"}
],
"examples": [
{
"title": "A plate's cross-section halfway up",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "body_section", "args": {"body": 0, "offset": 2.5, "plane": "XY"}}
]
},
{
"title": "The two contours through a plate with a bore",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"p0": [-15, -10], "p1": [15, 10], "type": "rectangle_2_point"}},
{"tool": "sketch_draw", "args": {"entities": [{"center": [0, 0], "radius": 4, "type": "circle_center"}]}},
{"tool": "sketch_finish", "args": {}},
{"tool": "extrude", "args": {"distance": 5, "sketch": 0}},
{"tool": "body_section", "args": {"body": 0, "offset": 2.5, "plane": "XY"}}
]
}
],
"ids": true
}
},
{
"id": "body_compare",
"name": "Body compare",
"section": "Inspect",
"slot": null,
"action": null,
"gui": false,
"tool": {
"access": "read",
"ok_false": false,
"summary": "Compare a body with a reference: volume, bbox, centroid and surface deviation (the RE acceptance metric).",
"details": "The reference is {step:path|body:id}; the surface deviation is max/mean/rms in mm.",
"params": [
{"name": "body", "type": "integer", "default": 0},
{"name": "reference", "type": "object"}
],
"examples": [
{
"title": "A 5 mm plate against a 6 mm one",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "extrude", "args": {"distance": 6, "height": 20, "operation": "new_body", "width": 20}},
{"tool": "body_compare", "args": {"body": 0, "reference": {"body": 1}}}
]
},
{
"title": "A plate against a reference part's STEP file",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "body_compare", "args": {"body": 0, "reference": {"step": "/path/to/reference.step"}}}
],
"needs": "a STEP file of the reference part"
}
],
"ids": false
}
},
{
"id": "sketch_describe",
"name": "Sketch describe",
"section": "Sketch",
"slot": null,
"action": null,
"gui": false,
"tool": {
"access": "read",
"ok_false": false,
"summary": "The open sketch, or a committed one: entities, constraint count and its loops.",
"details": "The loops are closed_loops {index, entities, holes, area}, open_ends, defects, buildable. The open sketch adds dof, the armed tool, the selection (entity indices) and selected_constraint, the index of the constraint picked by its badge or the Constraints list, null for none; a committed one adds its name and plane.",
"params": [
{"name": "sketch", "type": "integer", "default": null, "description": "a committed Sketch feature's index; omit for the open sketch"}
],
"examples": [
{
"title": "The open sketch: a rectangle with a circle inside it as a hole",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"p0": [-15, -10], "p1": [15, 10], "type": "rectangle_2_point"}},
{"tool": "sketch_draw", "args": {"entities": [{"center": [0, 0], "radius": 4, "type": "circle_center"}]}},
{"tool": "sketch_describe", "args": {}}
]
},
{
"title": "A committed sketch's plane, entities and loop",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"p0": [-15, -10], "p1": [15, 10], "type": "rectangle_2_point"}},
{"tool": "sketch_finish", "args": {}},
{"tool": "sketch_describe", "args": {"sketch": 0}}
]
}
],
"ids": false
}
},
{
"id": "sketch_validate",
"name": "Sketch validate",
"section": "Sketch",
"slot": null,
"action": null,
"gui": false,
"tool": {
"access": "read",
"ok_false": false,
"summary": "The open sketch's loops (closed_loops, open_ends, defects, buildable) and dof.",
"details": "",
"params": [
{"name": "tolerance", "type": "number", "unit": "mm", "default": 0.001, "description": "reported back"}
],
"examples": [
{
"title": "A triangle with a 0.05 mm gap: two open ends, not buildable",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"entities": [{"p0": [0, 0], "p1": [20, 0], "type": "line"}, {"p0": [20, 0.05], "p1": [20, 10], "type": "line"}, {"p0": [20, 10], "p1": [0, 0], "type": "line"}]}},
{"tool": "sketch_validate", "args": {}}
]
}
],
"ids": false
}
},
{
"id": "sketch_list_constraints",
"name": "Sketch list constraints",
"section": "Sketch",
"slot": null,
"action": null,
"gui": false,
"tool": {
"access": "read",
"ok_false": false,
"summary": "The constraints of the open sketch, or of a committed one: index, type, refs and value.",
"details": "A ref is {entity, role} for a point and {entity} for a whole entity; value is mm, or degrees for an angle. Reply: scope (live or committed), items, and dof and solve_ok for the open sketch.",
"params": [
{"name": "sketch", "type": "integer", "default": null, "description": "a committed Sketch feature's index; omit for the open sketch"}
],
"examples": [
{
"title": "The coincident, horizontal and vertical constraints a drawn rectangle gets",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"p0": [-15, -10], "p1": [15, 10], "type": "rectangle_2_point"}},
{"tool": "sketch_list_constraints", "args": {}}
]
},
{
"title": "A committed sketch's constraints",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"p0": [-15, -10], "p1": [15, 10], "type": "rectangle_2_point"}},
{"tool": "sketch_finish", "args": {}},
{"tool": "sketch_list_constraints", "args": {"sketch": 0}}
]
}
],
"ids": false
}
},
{
"id": "import_step",
"name": "Import step",
"section": "Document",
"slot": null,
"action": null,
"gui": false,
"tool": {
"access": "change",
"ok_false": true,
"summary": "Import a STEP file as native B-rep bodies (the reference part to measure).",
"details": "",
"params": [
{"name": "path", "type": "string", "description": "absolute path"}
],
"examples": [
{
"title": "A part read from a STEP file as a body",
"calls": [
{"tool": "import_step", "args": {"path": "/path/to/part.step"}}
],
"needs": "a STEP file of the part"
}
],
"ids": false
}
},
{
"id": "import_mesh",
"name": "Import mesh",
"section": "Document",
"slot": null,
"action": null,
"gui": false,
"tool": {
"access": "change",
"ok_false": true,
"summary": "Convert a triangle mesh (STL/OBJ) into an editable B-rep body.",
"details": "Reports whether the result is a real solid or an open shell, and why.",
"params": [
{"name": "path", "type": "string", "description": "absolute path"},
{"name": "tolerance", "type": "number", "default": 0.01},
{"name": "merge_angle_deg", "type": "number", "default": 5.0}
],
"examples": [
{
"title": "An STL mesh turned into an editable body",
"calls": [
{"tool": "import_mesh", "args": {"path": "/path/to/part.stl"}}
],
"needs": "an STL or OBJ mesh file"
}
],
"ids": false
}
},
{
"id": "sketch_blend_curve",
"name": "Sketch blend curve",
"section": "Sketch",
"slot": null,
"action": null,
"gui": false,
"tool": {
"access": "change",
"ok_false": true,
"summary": "Build a cubic-Bezier G1 bridge (BSpline) between two sketch-entity endpoints within a sketch feature.",
"details": "",
"params": [
{"name": "sketch", "type": "integer", "description": "sketch feature index"},
{"name": "ent_a", "type": "integer", "description": "first entity index within the sketch"},
{"name": "end_a", "type": "integer", "default": 1, "enum": [0, 1], "description": "0 = start/p0 side, 1 = end/p1 side"},
{"name": "ent_b", "type": "integer", "description": "second entity index within the sketch"},
{"name": "end_b", "type": "integer", "default": 0, "enum": [0, 1], "description": "0 = start/p0 side, 1 = end/p1 side"}
],
"examples": [
{
"title": "A smooth curve joining the facing ends of two lines in a committed sketch",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"entities": [{"p0": [-20, 0], "p1": [-5, 0], "type": "line"}, {"p0": [5, 10], "p1": [20, 10], "type": "line"}]}},
{"tool": "sketch_finish", "args": {}},
{"tool": "sketch_blend_curve", "args": {"end_a": 1, "end_b": 0, "ent_a": 0, "ent_b": 1, "sketch": 0}}
]
}
],
"ids": false
}
},
{
"id": "set_variable",
"name": "Set variable",
"section": "Document",
"slot": null,
"action": null,
"gui": false,
"tool": {
"access": "change",
"ok_false": true,
"summary": "Set a design variable to an expression, or remove it with an empty expr.",
"details": "Feature fields bound with feature_set_expression follow it.",
"params": [
{"name": "name", "type": "string"},
{"name": "expr", "type": "string", "description": "e.g. \"20\" or \"width / 2 + 3\"; \"\" removes the variable"}
],
"examples": [
{
"title": "A variable w of 20",
"calls": [
{"tool": "set_variable", "args": {"expr": "20", "name": "w"}}
]
},
{
"title": "A variable worked out from another: h = w / 2 + 3, which is 13",
"calls": [
{"tool": "set_variable", "args": {"expr": "20", "name": "w"}},
{"tool": "set_variable", "args": {"expr": "w / 2 + 3", "name": "h"}}
]
},
{
"title": "A variable removed with an empty expression",
"calls": [
{"tool": "set_variable", "args": {"expr": "20", "name": "w"}},
{"tool": "set_variable", "args": {"expr": "", "name": "w"}}
]
}
],
"ids": false
}
},
{
"id": "feature_set_expression",
"name": "Feature set expression",
"section": "History",
"slot": null,
"action": null,
"gui": false,
"tool": {
"access": "change",
"ok_false": true,
"summary": "Bind a feature's numeric field to an expression over the design variables, or unbind it with an empty expr.",
"details": "Unbound, the field keeps its value.",
"params": [
{"name": "feature", "type": "integer", "description": "feature index (describe_design)"},
{"name": "field", "type": "string", "description": "a numeric field of feature_describe's params, e.g. width, distance, hole_diameter, thread_diameter"},
{"name": "expr", "type": "string", "description": "\"\" removes the binding"}
],
"examples": [
{
"title": "A plate's thickness bound to the variable t",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "set_variable", "args": {"expr": "8", "name": "t"}},
{"tool": "feature_set_expression", "args": {"expr": "t", "feature": 1, "field": "distance"}}
]
},
{
"title": "A plate's thickness unbound, keeping the 8 mm the binding gave it",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "set_variable", "args": {"expr": "8", "name": "t"}},
{"tool": "feature_set_expression", "args": {"expr": "t", "feature": 1, "field": "distance"}},
{"tool": "feature_set_expression", "args": {"expr": "", "feature": 1, "field": "distance"}}
]
}
],
"ids": false
}
},
{
"id": "feature_move",
"name": "Feature move",
"section": "History",
"slot": null,
"action": null,
"gui": false,
"tool": {
"access": "change",
"ok_false": false,
"summary": "Move a feature one place up or down the history, as Move up / Move down do.",
"details": "A feature cannot come before one it uses. One undo step. Reply: feature (its new index), from.",
"params": [
{"name": "feature", "type": "integer", "description": "feature index (describe_design)"},
{"name": "delta", "type": "integer", "enum": [-1, 1], "description": "-1 up, 1 down"}
],
"examples": [
{
"title": "A datum plane moved up the history, above the extrude before it",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "construct_plane", "args": {"base": "XY", "offset": 20, "type": "offset"}},
{"tool": "feature_move", "args": {"delta": -1, "feature": 2}}
]
}
],
"ids": false
}
},
{
"id": "feature_suppress",
"name": "Feature suppress",
"section": "History",
"slot": null,
"action": null,
"gui": false,
"tool": {
"access": "change",
"ok_false": false,
"summary": "Suppress a feature, or bring it back, as its row's eye hides or shows it.",
"details": "A suppressed feature is left out of the rebuild and bodies may renumber. One undo step, none when it already was. Reply: feature, suppressed, changed, bodies.",
"params": [
{"name": "feature", "type": "integer", "description": "feature index (describe_design)"},
{"name": "suppressed", "type": "boolean", "description": "true leaves the feature out of the rebuild; false brings it back"}
],
"examples": [
{
"title": "A plate's hole hidden: the plate rebuilds without it",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "hole", "args": {"diameter": 5, "through": true}},
{"tool": "feature_suppress", "args": {"feature": 2, "suppressed": true}}
]
},
{
"title": "A hidden hole shown again",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "hole", "args": {"diameter": 5, "through": true}},
{"tool": "feature_suppress", "args": {"feature": 2, "suppressed": true}},
{"tool": "feature_suppress", "args": {"feature": 2, "suppressed": false}}
]
}
],
"ids": false
}
},
{
"id": "feature_rename",
"name": "Feature rename",
"section": "History",
"slot": null,
"action": null,
"gui": false,
"tool": {
"access": "change",
"ok_false": false,
"summary": "Rename a feature as F2 on its row does.",
"details": "Its own undo step. Reply: name, changed.",
"params": [
{"name": "feature", "type": "integer", "description": "feature index (describe_design)"},
{"name": "name", "type": "string", "description": "trimmed; not empty"}
],
"examples": [
{
"title": "A plate's extrude renamed Base plate",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "feature_rename", "args": {"feature": 1, "name": "Base plate"}}
]
}
],
"ids": false
}
},
{
"id": "body_set",
"name": "Body set",
"section": "Bodies",
"slot": null,
"action": null,
"gui": false,
"tool": {
"access": "change",
"ok_false": false,
"summary": "Rename, colour or show/hide a body, as its Bodies row and the Color button do; give one or more.",
"details": "Not in the undo history. The name and colour are saved with the project and the name names its committed object; visibility is view state, and commit_to_plate leaves hidden bodies out. Reply: name, color, visible.",
"params": [
{"name": "body", "type": "integer", "description": "body index (describe_design)"},
{"name": "name", "type": "string", "default": null, "description": "trimmed; not empty"},
{"name": "color", "type": "string", "default": null, "description": "\"#RRGGBB\""},
{"name": "visible", "type": "boolean", "default": null}
],
"examples": [
{
"title": "A plate's body named Base and coloured blue",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "body_set", "args": {"body": 0, "color": "#3366CC", "name": "Base"}}
]
},
{
"title": "The second of two bodies hidden",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "extrude", "args": {"distance": 10, "operation": "new_body", "profile": [[20, -5], [30, -5], [30, 5], [20, 5]]}},
{"tool": "body_set", "args": {"body": 1, "visible": false}}
]
}
],
"ids": false
}
},
{
"id": "commit_to_plate",
"name": "Commit to plate",
"section": "Document",
"slot": null,
"action": null,
"gui": false,
"tool": {
"access": "change",
"ok_false": false,
"summary": "Commit to Plate: send the visible bodies to Prepare at their Move-gizmo positions and show Prepare.",
"details": "It is one Prepare undo step. A lone body is sent even when hidden. A body named in the Bodies list or with body_set names its object or part. Reply: objects (object_list index after replace, name, parts: how many), bodies_sent, bodies_hidden, replaced.",
"params": [
{"name": "mode", "type": "string", "default": "", "enum": ["assembly", "bodies"], "description": "assembly: one object with a part per body; bodies: an object per body. Default: the Commit button's mode, which this leaves as it is."},
{"name": "replace", "type": "array", "default": [], "description": "object_list indices to delete in the same undo step, such as an earlier commit. Their settings, modifiers and paint go with them."}
],
"examples": [
{
"title": "A plate sent to Prepare as one object",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "commit_to_plate", "args": {}}
]
},
{
"title": "Two bodies sent to Prepare as an object each",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "extrude", "args": {"distance": 10, "operation": "new_body", "profile": [[20, -5], [30, -5], [30, 5], [20, 5]]}},
{"tool": "commit_to_plate", "args": {"mode": "bodies"}}
]
}
],
"ids": false
}
},
{
"id": "new_design",
"name": "New design",
"section": "Document",
"slot": null,
"action": null,
"gui": false,
"tool": {
"access": "change",
"ok_false": false,
"summary": "New Design: erase every feature, body and variable and the Design undo history.",
"details": "Committed objects stay on the plate. Reply: cleared {features, bodies, variables}.",
"params": [
{"name": "discard_changes", "type": "boolean", "default": false, "description": "needed when the design is not empty"}
],
"examples": [
{
"title": "A plate's design erased",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "new_design", "args": {"discard_changes": true}}
]
},
{
"title": "An empty design started over, which needs no discard_changes",
"calls": [
{"tool": "new_design", "args": {}}
]
}
],
"ids": false
}
},
{
"id": "export_step",
"name": "Export step",
"section": "Document",
"slot": null,
"action": null,
"gui": false,
"tool": {
"access": "change",
"ok_false": false,
"summary": "Export STEP: write every body to a file as native B-rep, at its Move-gizmo position.",
"details": "Reply: path, bytes, bodies, moved_bodies.",
"params": [
{"name": "path", "type": "string", "description": "absolute path; its directory must exist"},
{"name": "overwrite", "type": "boolean", "default": false, "description": "replace an existing file"}
],
"examples": [
{
"title": "A plate written to a STEP file",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "export_step", "args": {"path": "/path/to/part.step"}}
],
"needs": "a folder to write the STEP file in"
}
],
"ids": false
}
},
{
"id": "sketch_finish",
"name": "Sketch finish",
"section": "Sketch",
"slot": null,
"action": null,
"gui": false,
"tool": {
"access": "sketch",
"ok_false": true,
"summary": "Commit the open sketch as a Sketch feature, as the sketch's Confirm does, and leave sketch mode.",
"details": "A new sketch left empty is refused and stays open. A sketch re-opened with sketch_edit is replaced in place, in one undo step, with what is built on it rebuilt, and the reply adds replaced: true. A replace the rebuild refuses, or a re-opened sketch left empty, ends the edit with the design as it was and replies ok false, replaced false, its sketch_index and error, which says why it was not replaced. Reply: sketch_index, name, features (the new count) and its loops (closed_loops with the index extrude's loop takes, open_ends, defects, buildable).",
"params": [],
"examples": [
{
"title": "A rectangle around a circle, committed as a sketch of two loops",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"p0": [-15, -10], "p1": [15, 10], "type": "rectangle_2_point"}},
{"tool": "sketch_draw", "args": {"entities": [{"center": [0, 0], "radius": 4, "type": "circle_center"}]}},
{"tool": "sketch_finish", "args": {}}
]
}
],
"ids": false
}
},
{
"id": "sketch_cancel",
"name": "Sketch cancel",
"section": "Sketch",
"slot": null,
"action": null,
"gui": false,
"tool": {
"access": "sketch",
"ok_false": false,
"summary": "Discard the open sketch and leave sketch mode.",
"details": "A sketch re-opened with sketch_edit keeps what it had before the edit.",
"params": [],
"examples": [
{
"title": "Discard a sketch with a rectangle drawn",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"p0": [-15, -10], "p1": [15, 10], "type": "rectangle_2_point"}},
{"tool": "sketch_cancel", "args": {}}
]
}
],
"ids": false
}
},
{
"id": "sketch_edit",
"name": "Sketch edit",
"section": "Sketch",
"slot": null,
"action": null,
"gui": false,
"tool": {
"access": "sketch",
"ok_false": false,
"summary": "Re-open a committed sketch to change its entities and constraints, as Edit on its Feature tree row does.",
"details": "The sketch_ commands then act on it; sketch_finish replaces it in place, in one undo step, and rebuilds what is built on it, and sketch_cancel drops the changes. An extrude of one loop keeps its own copy of that loop and does not follow the edit. Refused while a sketch is open, and for text, imported art, a Project sketch and a sketch not drawn from entities. Reply: sketch, entities and constraints (how many the edit starts with) and plane.",
"params": [
{"name": "sketch", "type": "integer", "description": "a committed Sketch feature's index (describe_design's features[].index)"}
],
"examples": [
{
"title": "Re-open a committed rectangle",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"p0": [-15, -10], "p1": [15, 10], "type": "rectangle_2_point"}},
{"tool": "sketch_finish", "args": {}},
{"tool": "sketch_edit", "args": {"sketch": 0}}
]
},
{
"title": "Re-open the sketch a block is extruded from, which the block follows",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"p0": [-10, -5], "p1": [10, 5], "type": "rectangle_2_point"}},
{"tool": "sketch_finish", "args": {}},
{"tool": "extrude", "args": {"distance": 5, "sketch": 0}},
{"tool": "sketch_edit", "args": {"sketch": 0}}
]
}
],
"ids": false
}
},
{
"id": "sketch_draw",
"name": "Sketch draw",
"section": "Sketch",
"slot": null,
"action": null,
"gui": false,
"tool": {
"access": "sketch",
"ok_false": false,
"summary": "Draw a shape in the open sketch from its fields beside `type`, or a list of shapes as `entities`.",
"details": "Each type, and the fields it takes: line {p0, p1}; polyline {points: 2 or more, a loop when the last is the first}; rectangle_2_point {p0, p1: opposite corners}; rectangle_center {center, corner}; rectangle_3_point {p0, p1: one side; width: signed, to the left of p0 to p1}; rectangle_rounded {p0, p1: opposite corners; radius: of the corners}; circle_center {center, radius}; circle_2_point {p0, p1: the ends of a diameter}; circle_3_point {p0, p1, p2: on the circle}; arc_3_point {p0: start; p1: end; on_arc}; arc_center {center, radius, start_angle, end_angle}; arc_tangent {end; entity: the line or arc it leaves, the sketch's or one an item before it adds, at that one's end, along its direction there, left out the one added last}; slot {c0, c1, width}; slot_arc {center, start, end: its direction from the centre, width}; ellipse {center, radius (semi-major), rminor, rotation}; ellipse_arc {the ellipse's fields, start_angle, end_angle: parametric, counter-clockwise}; spline {ctrl: 2 or more poles}; polygon {center, sides, radius (to a vertex) or across_flats, angle (of that vertex, or of the first edge's midpoint)}; point {p}. A type refuses a field it does not take. Each is built as its drawing tool builds it: a rectangle, a slot or a polygon is one shape, which one undo of the sketch takes off whole, and a polyline is its lines, as its tool leaves them; the constraints are inferred exactly, so that none moves what is given. Each shape carries the constraints its tool gives it, at any slant; a constraint between a shape and the sketch's axes or what is already in the sketch, or between plain lines, is inferred only where it holds exactly, so a square on the axes is level only on a side lying exactly on one, with right angles holding the others. Each item of entities may carry its own construction; the top-level construction is the single-type form's, and beside entities each item's that gives none. Beside entities a shape's field, type among them, is refused: it belongs in its item. Points are [x, y] in the sketch plane (mm); angles are radians, or degrees as start_angle_deg and the like. A polygon is lines; its side count is not kept once committed. Reply: first_index, added, shapes [{first, count}] per item, entities, dof.",
"params": [
{"name": "entities", "type": "array", "default": [], "description": "shapes, each an object with its type and fields, drawn in order"},
{"name": "type", "type": "string", "default": "", "enum": ["line", "polyline", "rectangle_2_point", "rectangle_center", "rectangle_3_point", "rectangle_rounded", "circle_center", "circle_2_point", "circle_3_point", "arc_3_point", "arc_center", "arc_tangent", "slot", "slot_arc", "ellipse", "ellipse_arc", "spline", "polygon", "point"], "description": "one shape, its fields beside it"},
{"name": "p0", "type": "array", "default": null, "description": "line: its start; rectangle_2_point, rectangle_rounded: a corner; rectangle_3_point: one end of a side; circle_2_point: one end of a diameter; circle_3_point: a point on it; arc_3_point: its start. [x, y] in the sketch plane, mm"},
{"name": "p1", "type": "array", "default": null, "description": "line: its end; rectangle_2_point, rectangle_rounded: the opposite corner; rectangle_3_point: the side's other end; circle_2_point: the diameter's other end; circle_3_point: a second point on it; arc_3_point: its end. [x, y], mm"},
{"name": "p2", "type": "array", "default": null, "description": "circle_3_point: a third point on it, [x, y], mm"},
{"name": "on_arc", "type": "array", "default": null, "description": "arc_3_point: a point on it between its ends, [x, y], mm"},
{"name": "points", "type": "array", "default": null, "description": "polyline: its points, 2 or more [x, y], mm; the last on the first closes a loop"},
{"name": "corner", "type": "array", "default": null, "description": "rectangle_center: a corner, [x, y], mm"},
{"name": "center", "type": "array", "default": null, "description": "rectangle_center, circle_center, arc_center, slot_arc, ellipse, ellipse_arc, polygon: the centre, [x, y], mm"},
{"name": "radius", "type": "number", "unit": "mm", "default": null, "description": "rectangle_rounded: of its corners, less than half its shorter side; circle_center, arc_center: the radius; ellipse, ellipse_arc: the semi-major axis; polygon: centre to a vertex, in place of across_flats"},
{"name": "start_angle", "type": "number", "unit": "rad", "default": null, "description": "arc_center: the start, counter-clockwise from the plane's x axis, 0 when left out; ellipse_arc: the parametric start, which it requires; or start_angle_deg"},
{"name": "start_angle_deg", "type": "number", "unit": "deg", "default": null, "description": "arc_center, ellipse_arc: start_angle in degrees"},
{"name": "end_angle", "type": "number", "unit": "rad", "default": null, "description": "arc_center: the end, 0 when left out; ellipse_arc: the parametric end, which it requires; or end_angle_deg"},
{"name": "end_angle_deg", "type": "number", "unit": "deg", "default": null, "description": "arc_center, ellipse_arc: end_angle in degrees"},
{"name": "end", "type": "array", "default": null, "description": "arc_tangent: where it ends; slot_arc: a point in the direction its centreline ends, from the centre. [x, y], mm"},
{"name": "entity", "type": "integer", "default": null, "min": 0, "description": "arc_tangent: the index of the line or arc it leaves, one the sketch has or one an item before it adds, at that one's end along its direction there; left out, the entity added last"},
{"name": "start", "type": "array", "default": null, "description": "slot_arc: where its centreline starts, [x, y], mm"},
{"name": "c0", "type": "array", "default": null, "description": "slot: one end of its centreline, [x, y], mm"},
{"name": "c1", "type": "array", "default": null, "description": "slot: the other end of its centreline, [x, y], mm"},
{"name": "width", "type": "number", "unit": "mm", "default": null, "description": "rectangle_3_point: the distance to the far side, signed, to the left of p0 to p1; slot, slot_arc: its whole width"},
{"name": "rminor", "type": "number", "unit": "mm", "default": null, "description": "ellipse, ellipse_arc: the semi-minor axis, at most radius"},
{"name": "rotation", "type": "number", "unit": "rad", "default": null, "description": "ellipse, ellipse_arc: the major axis's angle from the plane's x axis, 0 when left out; or rotation_deg"},
{"name": "rotation_deg", "type": "number", "unit": "deg", "default": null, "description": "ellipse, ellipse_arc: rotation in degrees"},
{"name": "ctrl", "type": "array", "default": null, "description": "spline: its poles, 2 or more [x, y], mm"},
{"name": "sides", "type": "integer", "default": null, "min": 3, "max": 1000, "description": "polygon: its number of sides"},
{"name": "across_flats", "type": "number", "unit": "mm", "default": null, "description": "polygon: the distance between opposite flats, in place of radius"},
{"name": "angle", "type": "number", "unit": "rad", "default": null, "description": "polygon: the angle of the vertex radius reaches, or with across_flats of the first edge's midpoint, 0 when left out; or angle_deg"},
{"name": "angle_deg", "type": "number", "unit": "deg", "default": null, "description": "polygon: angle in degrees"},
{"name": "p", "type": "array", "default": null, "description": "point: where it is, [x, y], mm"},
{"name": "construction", "type": "boolean", "default": false, "description": "true draws construction geometry: the single-type form's shape, or each item of entities that gives no construction of its own"}
],
"examples": [
{
"title": "A 30 x 20 mm rectangle",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"p0": [-15, -10], "p1": [15, 10], "type": "rectangle_2_point"}}
]
},
{
"title": "A hexagon 10 mm across flats inside a circle",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"entities": [{"center": [0, 0], "radius": 12, "type": "circle_center"}, {"across_flats": 10, "center": [0, 0], "sides": 6, "type": "polygon"}]}}
]
},
{
"title": "A quarter arc given in degrees, and a slot",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"entities": [{"center": [0, 0], "end_angle_deg": 90, "radius": 20, "start_angle_deg": 0, "type": "arc_center"}, {"c0": [-10, -20], "c1": [10, -20], "type": "slot", "width": 6}]}}
]
}
],
"ids": false
}
},
{
"id": "sketch_select",
"name": "Sketch select",
"section": "Sketch",
"slot": null,
"action": null,
"gui": false,
"tool": {
"access": "sketch",
"ok_false": false,
"summary": "Select sketch entities by index; an empty list clears the selection.",
"details": "Reply: selected.",
"params": [
{"name": "entities", "type": "array", "default": [], "description": "entity indices"}
],
"examples": [
{
"title": "Select a rectangle's two long sides",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"p0": [-15, -10], "p1": [15, 10], "type": "rectangle_2_point"}},
{"tool": "sketch_select", "args": {"entities": [0, 2]}}
]
},
{
"title": "Clear the selection",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"p0": [-15, -10], "p1": [15, 10], "type": "rectangle_2_point"}},
{"tool": "sketch_select", "args": {"entities": [0]}},
{"tool": "sketch_select", "args": {"entities": []}}
]
}
],
"ids": false
}
},
{
"id": "sketch_repair",
"name": "Sketch repair",
"section": "Sketch",
"slot": null,
"action": null,
"gui": false,
"tool": {
"access": "sketch",
"ok_false": false,
"summary": "Weld sketch endpoints that nearly meet and constrain them coincident, so loops are closed by construction.",
"details": "Reply: welded and the loops.",
"params": [
{"name": "tolerance", "type": "number", "unit": "mm", "default": 0.001},
{"name": "ignore_construction", "type": "boolean", "default": true}
],
"examples": [
{
"title": "Close a triangle's 0.05 mm gap",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"entities": [{"p0": [0, 0], "p1": [20, 0], "type": "line"}, {"p0": [20, 0.05], "p1": [20, 10], "type": "line"}, {"p0": [20, 10], "p1": [0, 0], "type": "line"}]}},
{"tool": "sketch_repair", "args": {"tolerance": 0.1}}
]
}
],
"ids": false
}
},
{
"id": "sketch_set_value",
"name": "Sketch set value",
"section": "Sketch",
"slot": null,
"action": null,
"gui": false,
"tool": {
"access": "sketch",
"ok_false": false,
"summary": "Set the dimension of the selected sketch entities, as the value field does.",
"details": "A line's length, a circle's diameter, an arc's radius, or the angle or distance between two. Select them with sketch_select first. Reply: kind, before, value, dof and the loops.",
"params": [
{"name": "value", "type": "number", "description": "mm, or degrees for an angle"}
],
"examples": [
{
"title": "A rectangle's bottom side made 40 mm long",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"p0": [-15, -10], "p1": [15, 10], "type": "rectangle_2_point"}},
{"tool": "sketch_select", "args": {"entities": [0]}},
{"tool": "sketch_set_value", "args": {"value": 40}}
]
},
{
"title": "A circle's diameter set to 12 mm",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"entities": [{"center": [0, 0], "radius": 4, "type": "circle_center"}]}},
{"tool": "sketch_select", "args": {"entities": [0]}},
{"tool": "sketch_set_value", "args": {"value": 12}}
]
}
],
"ids": false
}
},
{
"id": "sketch_transform",
"name": "Sketch transform",
"section": "Sketch",
"slot": null,
"action": null,
"gui": false,
"tool": {
"access": "sketch",
"ok_false": false,
"summary": "Move, rotate or scale entities of the open sketch, as the transform tools' Confirm does.",
"details": "move {dx, dy}, rotate {angle, pivot} and scale {scale, pivot} change the entities and release the constraints that no longer hold. pivot defaults to the entities' centroid. Angles are radians, or degrees as angle_deg. Reply: type, moved, released_constraints, pivot, entities, dof.",
"params": [
{"name": "type", "type": "string", "enum": ["move", "rotate", "scale"]},
{"name": "entities", "type": "array", "default": [], "description": "entity indices; omit for the selection"},
{"name": "dx", "type": "number", "unit": "mm", "default": 0},
{"name": "dy", "type": "number", "unit": "mm", "default": 0},
{"name": "angle", "type": "number", "unit": "rad", "default": null, "nullable": false, "description": "rotate's angle, or angle_deg"},
{"name": "angle_deg", "type": "number", "unit": "deg", "default": null, "nullable": false, "description": "rotate's angle in degrees, in place of angle"},
{"name": "scale", "type": "number", "default": null, "nullable": false},
{"name": "pivot", "type": "array", "default": null, "nullable": false, "description": "[x, y] in the sketch plane, mm"}
],
"examples": [
{
"title": "A circle moved 10 mm along x",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"entities": [{"center": [0, 0], "radius": 3, "type": "circle_center"}]}},
{"tool": "sketch_transform", "args": {"dx": 10, "entities": [0], "type": "move"}}
]
},
{
"title": "A line turned 30 degrees about its start",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"entities": [{"p0": [0, 0], "p1": [20, 0], "type": "line"}]}},
{"tool": "sketch_transform", "args": {"angle_deg": 30, "entities": [0], "pivot": [0, 0], "type": "rotate"}}
]
}
],
"ids": false
}
},
{
"id": "sketch_pattern",
"name": "Sketch pattern",
"section": "Sketch",
"slot": null,
"action": null,
"gui": false,
"tool": {
"access": "sketch",
"ok_false": false,
"summary": "Repeat entities of the open sketch in a row or around a point, as the Linear and Polar array tools do.",
"details": "linear adds copies stepped by dx, dy; circular adds copies every angle/count about pivot (angle is the whole sweep, default 360 degrees). count includes the original, and each copy is bound to its source (equal length and parallel, or its radius). Angles are radians, or degrees as angle_deg. Reply: type, first_index, added, bound, pivot (circular), entities, dof.",
"params": [
{"name": "type", "type": "string", "enum": ["linear", "circular"]},
{"name": "entities", "type": "array", "default": [], "description": "entity indices; omit for the selection"},
{"name": "count", "type": "integer", "default": null, "nullable": false, "min": 2, "max": 1000, "description": "instances, the original among them; required"},
{"name": "dx", "type": "number", "unit": "mm", "default": 0, "description": "linear: the step"},
{"name": "dy", "type": "number", "unit": "mm", "default": 0, "description": "linear: the step"},
{"name": "angle", "type": "number", "unit": "rad", "default": null, "nullable": false, "description": "circular: the whole sweep, or angle_deg"},
{"name": "angle_deg", "type": "number", "unit": "deg", "default": null, "nullable": false, "description": "circular: the whole sweep in degrees, in place of angle"},
{"name": "pivot", "type": "array", "default": null, "nullable": false, "description": "circular, which requires it: the centre [x, y] in the sketch plane, mm"}
],
"examples": [
{
"title": "Six holes on a 40 mm bolt circle",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"entities": [{"center": [20, 0], "radius": 3, "type": "circle_center"}]}},
{"tool": "sketch_pattern", "args": {"angle_deg": 360, "count": 6, "entities": [0], "pivot": [0, 0], "type": "circular"}}
]
},
{
"title": "Three holes 10 mm apart along x",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"entities": [{"center": [0, 0], "radius": 2, "type": "circle_center"}]}},
{"tool": "sketch_pattern", "args": {"count": 3, "dx": 10, "entities": [0], "type": "linear"}}
]
}
],
"ids": false
}
},
{
"id": "sketch_delete_constraint",
"name": "Sketch delete constraint",
"section": "Sketch",
"slot": null,
"action": null,
"gui": false,
"tool": {
"access": "sketch",
"ok_false": false,
"summary": "Delete a constraint of the open sketch, as its row's delete button does; the constraints after it move down one index.",
"details": "Reply: removed, constraints, dof, solve_ok.",
"params": [
{"name": "index", "type": "integer", "description": "sketch_list_constraints' items[].index"}
],
"examples": [
{
"title": "A rectangle's bottom side freed from horizontal",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"p0": [-15, -10], "p1": [15, 10], "type": "rectangle_2_point"}},
{"tool": "sketch_list_constraints", "args": {}},
{"tool": "sketch_delete_constraint", "args": {"index": 4}}
]
}
],
"ids": false
}
},
{
"id": "list_align_types",
"name": "Align types",
"section": "Solid",
"slot": null,
"action": null,
"gui": false,
"tool": {
"access": "read",
"ok_false": false,
"summary": "Which align types fit a pair of coordinate systems, and why each other one does not.",
"details": "As the Mate card dims the types it does not offer. Reply: cs_a, cs_b and types, the five align types in order (fastened, planar, revolute, slider, cylindrical), each {type, fits, reason}, reason null where it fits.",
"params": [
{"name": "cs_a", "type": "integer", "description": "feature index of the fixed CoordSys, align's cs_a"},
{"name": "cs_b", "type": "integer", "description": "feature index of the CoordSys on the body that moves, align's cs_b"}
],
"examples": [
{
"title": "The types that fit a plate's top-face connector and a block's bottom-face one",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "extrude", "args": {"distance": 10, "operation": "new_body", "profile": [[30, -5], [40, -5], [40, 5], [30, 5]]}},
{"tool": "body_describe", "args": {"at_extreme": "+z", "body": 0}},
{"tool": "construct_coordinate_system", "args": {"body": 0, "face": 5, "generation": {"from_call": 2, "key": "generation"}, "type": "face_and_direction"}},
{"tool": "body_describe", "args": {"at_extreme": "-z", "body": 1}},
{"tool": "construct_coordinate_system", "args": {"body": 1, "face": 4, "generation": {"from_call": 4, "key": "generation"}, "type": "face_and_direction"}},
{"tool": "list_align_types", "args": {"cs_a": 4, "cs_b": 5}}
]
}
],
"ids": false
}
},
{
"id": "select_geometry",
"name": "Select geometry",
"section": "Document",
"slot": null,
"action": null,
"gui": false,
"tool": {
"access": "change",
"ok_false": false,
"summary": "Select a body, a face, edges, a vertex, a reference plane, a sketch's loop or a feature by id, as a click selects it.",
"details": "One form: body; body with face, edges (the last the current edge, as in a Shift+click set) or vertex; plane; sketch with loop; feature; or nothing, which clears the selection. A body is selected as a click on its row of the Bodies list selects it, a face, edges or a vertex as a click in the view picks them, a loop as a click on it, which also selects its Sketch's row, and a feature as a click on its row of the Feature list. A plane is picked only where a click can pick one: while the Origin row shows the planes, or while Sketch waits for its plane (sketch_create {}), where picking it opens the sketch. A loop is numbered as sketch_describe {sketch} numbers closed_loops and extrude {sketch, loop} takes it, and is selected only while the view shows it: an extrude that takes the whole sketch hides the sketch, and one that takes a loop hides that loop. Whatever was selected goes first, of every kind. The menu-item forms then act on the selection: feature_edit, rename_selected, feature_delete and sketch_constrain_selected called with no arguments act on the selected row of the Feature list while nothing is picked in the view, and zoom_to_selection acts on what is picked in the view, so a sketch is zoomed to through sketch with loop, not through feature. Refused, changing nothing, for an id the model does not have, and while a card, a sketch, Constrain mode, a body Move or the Text dialog is open, where a click means something else. Reply: selection {kind, id}, plane and feature, as describe_design reports selection, picked_plane and feature_row; for a vertex also point, as body_describe gives it, and placed_point, where the view draws it (the same unless the body was moved).",
"params": [
{"name": "body", "type": "integer", "default": null, "min": 0, "description": "body index (describe_design); alone, the whole body"},
{"name": "face", "type": "integer", "default": null, "min": 0, "description": "a face id of body (body_describe)"},
{"name": "edges", "type": "array", "default": null, "description": "edge ids of body (body_describe), one or more"},
{"name": "vertex", "type": "integer", "default": null, "min": 0, "description": "a vertex id of body (body_describe {vertices: true})"},
{"name": "plane", "type": "string", "default": null, "enum": ["XY", "XZ", "YZ"], "description": "a reference plane"},
{"name": "sketch", "type": "integer", "default": null, "min": 0, "description": "feature index of a committed sketch"},
{"name": "loop", "type": "integer", "default": null, "min": 0, "description": "a closed loop of sketch: its index in sketch_describe's closed_loops"},
{"name": "feature", "type": "integer", "default": null, "min": 0, "description": "feature index (describe_design): its row of the Feature list"}
],
"examples": [
{
"title": "A plate selected whole, as a click on its row of the Bodies list selects it",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "select_geometry", "args": {"body": 0}}
]
},
{
"title": "A plate's top face selected, as a click on it selects it",
"calls": [
{"tool": "extrude", "args": {"distance": 5, "height": 20, "width": 20}},
{"tool": "body_describe", "args": {"at_extreme": "+z", "body": 0}},
{"tool": "select_geometry", "args": {"body": 0, "face": 5, "generation": {"from_call": 1, "key": "generation"}}}
]
},
{
"title": "A sketched square's loop selected, which selects its Sketch's row too",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"p0": [-10, -10], "p1": [10, 10], "type": "rectangle_2_point"}},
{"tool": "sketch_finish", "args": {}},
{"tool": "select_geometry", "args": {"loop": 0, "sketch": 0}}
]
}
],
"ids": true
}
},
{
"id": "confirm_tool",
"name": "Confirm tool",
"section": "Document",
"slot": null,
"action": null,
"gui": false,
"tool": {
"access": "ui",
"ok_false": false,
"summary": "Confirm what is open in the Design tab, as its Confirm button and Enter do.",
"details": "What is open, in the order Confirm takes it: the Text dialog (text), a value field (value), a body Move (move), a text or art placement (insert), a feature card (card), a sketch (sketch), Constrain mode (constrain). The Text dialog takes it as its OK does: a new text goes into the design, its placement then open (insert), and an edited one keeps its new words. A card adds or edits its feature in one undo step and closes; an add the card refuses, or whose rebuild fails, leaves no feature and no undo step and keeps the card open with the reason on the status line. A Confirm that does not take, such as that add or a value that is no number, replies ok false. It runs under what is open, which refuses the commands that change the document. Refused, changing nothing, when nothing is open, while Sketch waits for its plane (pick one with select_geometry {plane}, or call cancel_tool), while the Text dialog's OK is off, with no text to insert, with the dialog's reason, and while Confirm is off, such as for a card whose preview fails, with the status line as the reason. Reply: was, what was open; ok, whether it took the Confirm; feature, the index of the feature added or edited, or null; open, what is still open, or null; status, the status line.",
"params": [],
"examples": [
{
"title": "A sketched rectangle committed, as the sketch's Confirm commits it",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"p0": [-15, -10], "p1": [15, 10], "type": "rectangle_2_point"}},
{"tool": "confirm_tool", "args": {}}
]
}
],
"ids": false
}
},
{
"id": "cancel_tool",
"name": "Cancel tool",
"section": "Document",
"slot": null,
"action": null,
"gui": false,
"tool": {
"access": "ui",
"ok_false": false,
"summary": "Cancel what is open in the Design tab, as its Cancel button does.",
"details": "What is open, in the order Cancel takes it: the Text dialog (text), closed as its Cancel closes it, with a new text not added and an edited one as it was, a value field (value), a body Move (move), put back where it started, a text or art placement (insert), a feature card (card), with nothing added or edited, Sketch waiting for its plane (plane_pick), a sketch (sketch), discarded without the dialog a person gets, a re-opened one kept as it was, and Constrain mode (constrain). It runs under what is open, which refuses the commands that change the document. Refused when nothing is open. Reply: was, what was open, and status, the status line.",
"params": [],
"examples": [
{
"title": "A sketch holding a line discarded, with no dialog",
"calls": [
{"tool": "sketch_create", "args": {"plane": "XY"}},
{"tool": "sketch_draw", "args": {"entities": [{"p0": [0, 0], "p1": [10, 0], "type": "line"}]}},
{"tool": "cancel_tool", "args": {}}
]
}
],
"ids": false
}
},
{
"id": "body_place",
"name": "Place body",
"section": "Bodies",
"slot": null,
"action": null,
"gui": false,
"tool": {
"access": "change",
"ok_false": false,
"summary": "Place a body where Commit to Plate and Export STEP send it: move it, turn it, lay a face on the bed, or put it back.",
"details": "The Bodies row's Move and Place on Face, outside the history: no undo step, and the project file does not keep it. One form: move and rotate, either or both, added to where the body stands as the Move / Rotate card adds them, the turn about the body's centre; face, which lays that face on the bed as Place on Face does; or reset: true, which puts the body back where the model has it. The view draws and picks the body where it stands, and its placement follows it when the bodies are renumbered. Refused, changing nothing, for a body or face the model does not have, for none or more than one of the forms, and while a card, a sketch, Constrain mode, a body Move or the Text dialog is open. Reply: ok, body, moved and placement, as describe_design reports them.",
"params": [
{"name": "body", "type": "integer", "min": 0, "description": "body index (describe_design)"},
{"name": "move", "type": "array", "unit": "mm", "default": null, "description": "[dx, dy, dz] in the world frame"},
{"name": "rotate", "type": "object", "default": null, "description": "{\"axis\": \"x\", \"y\" or \"z\", \"angle\": degrees}: a turn about that world axis through the body's centre"},
{"name": "face", "type": "integer", "default": null, "min": 0, "description": "a face id of body (body_describe), laid on the bed"},
{"name": "reset", "type": "boolean", "default": false, "description": "true: back where the model has it"}
],
"examples": [
{
"title": "A box moved 10 mm along x and turned a quarter turn about z",
"calls": [
{"tool": "extrude", "args": {"distance": 10, "height": 20, "width": 30}},
{"tool": "body_place", "args": {"body": 0, "move": [10, 0, 0], "rotate": {"angle": 90, "axis": "z"}}}
]
},
{
"title": "A box laid on its side face whose normal is -y",
"calls": [
{"tool": "extrude", "args": {"distance": 10, "height": 20, "width": 30}},
{"tool": "body_describe", "args": {"at_extreme": "-y", "body": 0}},
{"tool": "body_place", "args": {"body": 0, "face": 0, "generation": {"from_call": 1, "key": "generation"}}}
]
}
],
"ids": true
}
}
],
"chrome_only": {
"_why": "document-level actions act on the DOCUMENT, not on a selection, so they stay in chrome and never enter the offer (see 4.1) Text and SVG were removed from this list 2026-08-01: they create a Sketch feature on the picked face, so they consume a selection like any other Create verb.",
"items": [
"Import STEP",
"Import mesh",
"Export STEP",
"Commit to Plate",
"Undo",
"Redo",
"Variables",
"Section view",
"Origin planes",
"World axes"
]
},
"_ratified": "Row order ratified 2026-07-31 by Tommaso. Changing an index is a breaking change (charter 4.1)."
}