create_sketch
Creates a 2D sketch on XY, XZ, or YZ planes with lines, circles, arcs, polylines, and optional constraints to define geometry for CAD operations.
Instructions
Create a 2D sketch (FreeCAD Sketcher with a real constraint solver). plane XY (x,y; normal +Z), XZ (sketch x,y map to
world x,z; normal -Y) or YZ (maps to world y,z; normal +X); offset shifts the plane along its normal.
geometry items (sketch coordinates in mm; index = position in the list, starting 0): {"type":"line","p1":[x,y],"p2":[x,y]},
{"type":"circle","center":[x,y],"radius":r}, {"type":"arc","center":[x,y],"radius":r,"start_deg":a,"end_deg":b} (counter-
clockwise), {"type":"polyline","points":[[x,y],...]} (closed polygon, expands to one line per side). Add "construction":true
for reference geometry. Closed loops become faces; a loop inside another becomes a hole.
constraints (optional, reference geometry by index geo/geo2, point ids pos 1=start, 2=end, 3=centre): coincident
(geo,pos,geo2,pos2), horizontal, vertical, parallel, perpendicular, equal, tangent, radius/diameter (geo,value), length
(geo,value), distance_x/distance_y (geo,value), lock (geo,pos,x,y). Returns closed/open wire counts and solver DOF (0 = fully
constrained). Next: pad, pocket, revolve, loft or sweep.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| doc | Yes | ||
| name | Yes | ||
| plane | No | XY | |
| offset | No | ||
| geometry | No | ||
| constraints | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |