yas1nsyed/CADomatic
Tentang
An AI powered CAD design generator for FreeCAD
Sains dan teknikYang dapat Anda lakukan
- π Automate repetitive CAD tasks
- π§± Build part libraries as code
- π§ͺ Integrate CAD into testing or CI workflows
- π§ Customize geometry by changing script parameters
Pertumbuhan bintang terukur
- dalam 24 jam
- 0
- dalam 7 hari
- Mengumpulkan riwayat
- dalam 15 hari
- Mengumpulkan riwayat
- dalam 1 bulan
- Mengumpulkan riwayat
Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.
README.md
AsliCADomatic π οΈ
From prompt to CAD
Preview CADomatic on Hugging face
CADomatic is a Python-based tool that generates editable parametric CAD scripts for FreeCAD. Instead of creating static 3D models, CADomatic produces fully customizable CAD models with Python scripts that build CAD geometry β allowing engineers to programmatically define parts, reuse templates, and iterate fast.
π What It Does

CADomatic Demo

Fully editable parametric designs
- β Generates editable FreeCAD Python scripts for parts like screws, nuts, fasteners, and more
- β Each script can be modified for custom parameters (length, diameter, features, etc.)
- β
Outputs native
.pyscripts which use FreeCADβs API to build geometry - β Enables version-controlled, reusable, parametric CAD pipelines
- β Eliminates the need for manual modeling in the FreeCAD GUI
Workflow
Current workflow of CADomatic v 1.0
- Current Workflow (v1.0)
The current version of CADomatic follows a simple pipeline to generate CAD models from natural language descriptions:
- User Input β Provide a design description as text.
- LLM Processing β The LLM generates a FreeCAD Python script.
- Model Creation β The script runs in FreeCAD (via CADomatic) to create a 3D model and render an image.
- Output β The final CAD file and preview image are returned to the user.
Proposed workflow of CADomatic v 2.0
- Proposed Workflow (v2.0)
I am currently working on an enhanced workflow for CADomatic v2.0, which introduces image-based validation, feedback loops, and optional reference images for higher accuracy and user control:
- User Input β Provide a text description and optionally a reference keyword.
- Reference Image Input β Provide an optional reference image or a drafting of the desired CAD model.
- LLM Processing β The LLM generates a FreeCAD Python script.
- Model Creation & Rendering β CADomatic creates the 3D model and renders an image.
- Similarity Scoring β The rendered image is compared against reference images to compute a similarity score.
- Validation & Feedback Loop
- If the score meets the threshold, the final CAD model is returned.
- If not, a VLM compares the images, explains differences, and feeds the desired changes into the LLM for regeneration for furtehr refinement.
π‘ Why Use CADomatic?
- π Automate repetitive CAD tasks
- π§± Build part libraries as code
- π§ͺ Integrate CAD into testing or CI workflows
- π§ Customize geometry by changing script parameters
- π Keep models lightweight and editable at the code level
π¬ Example Prompts
Here are some example natural language prompts you can use to generate CAD scripts with CADomatic:
- "Build a flange with a 100mm outer diameter, 10mm thickness, and 6 bolt holes evenly spaced."
- "Make a cylindrical spacer, 20mm diameter and 30mm height, with a 5mm through hole."
- "Produce a washer with an outer diameter of 25mm and an inner diameter of 10mm."
- "Design a toy car with a rectangular box as the body and 4 circular wheels attached to the sides of the box."
These prompts will be converted into editable Python scripts that you can modify and reuse.
β οΈ This is the first version of CADomatic β a flash of what's possible.
Future versions under development will include:
- Improved LLM-driven script generation
- A dedicated user interface for part selection and parameter tuning
- More robust template and geometry libraries
π How to Use CADomatic
β Prerequisites
βοΈ Setup
git clone https://github.com/yas1nsyed/CADomatic.git
cd CADomatic
# Create and activate virtual environment
python -m venv .venv
.venv\Scripts\activate
# Install dependencies
uv pip install -r requirements.txt
Create a .env file in the project root:
βΆοΈ Run CADomatic
# Run the program
uv run main.py
- Enter your prompt (e.g., "Create a 10mm cube with 2mm hole").
- FreeCAD will auto-launch with your generated model.
π€ Use CADomatic with Claude Code
Claude Code can build models directly in your open FreeCAD through the FreeCAD MCP server (a third-party project). This route does not need a Gemini API key.
The repository includes:
| File | Purpose |
|---|---|
.mcp.json |
Connects Claude Code to the FreeCAD MCP server |
CLAUDE.md |
Tells Claude how the project works and to understand it before making changes |
.claude/skills/freecad-model |
Builds a part using CADomatic's modelling rules |
.claude/skills/freecad-verify |
Checks dimensions, geometry and screenshots |
1. Install the tools
Install FreeCAD, Claude Code and uv (on macOS: brew install uv). uvx, which comes with uv, downloads and runs the MCP server.
2. Install the FreeCAD addon (once)
Run this outside the CADomatic folder. The addon version must match the server version in .mcp.json.
git clone --branch v0.1.33 https://github.com/neka-nat/freecad-mcp.git
Copy the freecad-mcp/addon/FreeCADMCP folder into FreeCAD's Mod folder. To find that folder, run this in FreeCAD's Python console (View β Panels β Python console):
import os; print(os.path.join(FreeCAD.getUserAppDataDir(), "Mod"))
On macOS with FreeCAD 1.1, for example (for FreeCAD 1.0, use v1-0):
mkdir -p ~/Library/Application\ Support/FreeCAD/v1-1/Mod
cp -r freecad-mcp/addon/FreeCADMCP ~/Library/Application\ Support/FreeCAD/v1-1/Mod/
See the installation guide for other systems.
3. Start the connection (every session)
- Open FreeCAD (restart it after installing the addon).
- Select the MCP Addon workbench and click Start RPC Server. It listens on
127.0.0.1:9875. To start it automatically, enable Auto-Start Server in the FreeCAD MCP menu. - In the CADomatic folder, run
claude. - Approve the project's
freecadMCP server when asked. - Type
/mcpand check thatfreecadis connected.
4. Try it
- "Explain how this project works."
/freecad-modelmake a flange with OD 100mm, bore 50mm, thickness 7.5mm and 6 M12 holes at PCD 75mm/freecad-verifycheck the flange against those dimensions
Claude also picks these skills automatically from a normal request. Final scripts are saved in generated/.
Troubleshooting
| Problem | Fix |
|---|---|
freecad fails to start |
Run uvx freecad-mcp==0.1.33 --help in a terminal. If uvx is not found, install uv and restart the terminal |
| Server connects but tools fail | Check that FreeCAD is open and the RPC server is started |
| MCP Addon workbench is missing | Check that Mod/FreeCADMCP/InitGui.py exists, restart FreeCAD and check View β Panels β Report view |
| Version mismatch warning | Use the same version for the addon and .mcp.json |
| You declined the server earlier | Run claude mcp reset-project-choices, then start claude again |
execute_code_headless cannot find FreeCAD |
Add "--freecadcmd", "<full path to freecadcmd>" to args in .mcp.json |
β οΈ The MCP server can run any Python code inside FreeCAD with your user permissions. Review tool calls before approving them, and keep Remote Connections off unless you need it.
Jelajahi proyek terkait
Memuatβ¦