FreeCAD

FreeCAD

neka-nat

Provides programmatic control of FreeCAD software through an RPC interface, allowing AI assistants to create and modify 3D CAD models by executing commands remotely.

5833,434 views113Local (stdio)

What it does

  • Create and manage FreeCAD documents
  • Generate 3D objects and parts programmatically
  • Execute custom Python code in FreeCAD
  • Insert parts from component libraries
  • Capture screenshots of 3D models
  • Edit and delete existing CAD objects

Best for

AI-driven generative design workflowsAutomated CAD model creation from descriptionsRapid prototyping and design iterationConverting 2D drawings to 3D models
Remote control of full FreeCAD installationSupports Part, Draft, PartDesign workbenchesVisual feedback through screenshots

Tools (10)

create_document

Create a new document in FreeCAD. Args: name: The name of the document to create. Returns: A message indicating the success or failure of the document creation. Examples: If you want to create a document named "MyDocument", you can use the following data. ```json { "name": "MyDocument" } ```

create_object

Create a new object in FreeCAD. Object type is starts with "Part::" or "Draft::" or "PartDesign::" or "Fem::". Args: doc_name: The name of the document to create the object in. obj_type: The type of the object to create (e.g. 'Part::Box', 'Part::Cylinder', 'Draft::Circle', 'PartDesign::Body', etc.). obj_name: The name of the object to create. obj_properties: The properties of the object to create. Returns: A message indicating the success or failure of the object creation and a screenshot of the object. Examples: If you want to create a cylinder with a height of 30 and a radius of 10, you can use the following data. ```json { "doc_name": "MyCylinder", "obj_name": "Cylinder", "obj_type": "Part::Cylinder", "obj_properties": { "Height": 30, "Radius": 10, "Placement": { "Base": { "x": 10, "y": 10, "z": 0 }, "Rotation": { "Axis": { "x": 0, "y": 0, "z": 1 }, "Angle": 45 } }, "ViewObject": { "ShapeColor": [0.5, 0.5, 0.5, 1.0] } } } ``` If you want to create a circle with a radius of 10, you can use the following data. ```json { "doc_name": "MyCircle", "obj_name": "Circle", "obj_type": "Draft::Circle", } ``` If you want to create a FEM analysis, you can use the following data. ```json { "doc_name": "MyFEMAnalysis", "obj_name": "FemAnalysis", "obj_type": "Fem::AnalysisPython", } ``` If you want to create a FEM constraint, you can use the following data. ```json { "doc_name": "MyFEMConstraint", "obj_name": "FemConstraint", "obj_type": "Fem::ConstraintFixed", "analysis_name": "MyFEMAnalysis", "obj_properties": { "References": [ { "object_name": "MyObject", "face": "Face1" } ] } } ``` If you want to create a FEM mechanical material, you can use the following data. ```json { "doc_name": "MyFEMAnalysis", "obj_name": "FemMechanicalMaterial", "obj_type": "Fem::MaterialCommon", "analysis_name": "MyFEMAnalysis", "obj_properties": { "Material": { "Name": "MyMaterial", "Density": "7900 kg/m^3", "YoungModulus": "210 GPa", "PoissonRatio": 0.3 } } } ``` If you want to create a FEM mesh, you can use the following data. The `Part` property is required. ```json { "doc_name": "MyFEMMesh", "obj_name": "FemMesh", "obj_type": "Fem::FemMeshGmsh", "analysis_name": "MyFEMAnalysis", "obj_properties": { "Part": "MyObject", "ElementSizeMax": 10, "ElementSizeMin": 0.1, "MeshAlgorithm": 2 } } ```

edit_object

Edit an object in FreeCAD. This tool is used when the `create_object` tool cannot handle the object creation. Args: doc_name: The name of the document to edit the object in. obj_name: The name of the object to edit. obj_properties: The properties of the object to edit. Returns: A message indicating the success or failure of the object editing and a screenshot of the object.

delete_object

Delete an object in FreeCAD. Args: doc_name: The name of the document to delete the object from. obj_name: The name of the object to delete. Returns: A message indicating the success or failure of the object deletion and a screenshot of the object.

execute_code

Execute arbitrary Python code in FreeCAD. Args: code: The Python code to execute. Returns: A message indicating the success or failure of the code execution, the output of the code execution, and a screenshot of the object.

Alternatives