Create or modify 3D CAD models in FreeCAD using parametric operations.
Use when user asks to:
{
"operation": "create_primitive | boolean | transform | batch | export | inspect | modifier | array | profile",
"parameters": { ... }
}
On success, the script prints a JSON payload to stdout containing the names, bounding boxes, and metadata of all active objects. This acts as your visual feedback interface.
batch to combine steps. python {baseDir}/scripts/cad_engine.py '
Read the returned JSON from stdout to see resulting object names and bounding boxes.
inspect operation to voluntarily query document state without making modifications.batch operation.Create a Primitive:
{
"operation": "create_primitive",
"parameters": {
"type": "box",
"length": 100,
"width": 100,
"height": 50,
"name": "MyBox",
"position": [0, 0, 0]
}
}
Batch CSG (Cut a hole in a box):
{
"operation": "batch",
"parameters": {
"steps": [
{
"operation": "create_primitive",
"parameters": {
"type": "box",
"length": 50, "width": 50, "height": 10,
"name": "BaseBox"
}
},
{
"operation": "create_primitive",
"parameters": {
"type": "cylinder",
"radius": 5, "height": 10,
"name": "HoleCyl",
"position": [25, 25, 0]
}
},
{
"operation": "boolean",
"parameters": {
"type": "cut",
"base": "BaseBox",
"tool": "HoleCyl",
"name": "ResultShape"
}
}
]
}
}
Scale:
{
"operation": "scale_object",
"parameters": {
"scale_factor": 0.8
}
}
共 1 个版本