Skip to content
المشاريع

حول

An AI powered CAD design generator for FreeCAD

العلوم والهندسة

كيف تُقاس هذه الأرقام

ما يمكنك فعله

  • 🔁 Automate repetitive CAD tasks
  • 🧱 Build part libraries as code
  • 🧪 Integrate CAD into testing or CI workflows
  • 🔧 Customize geometry by changing script parameters

النمو المقاس للنجوم

خلال 24 ساعة
٠
خلال 7 أيام
جارٍ جمع السجل
خلال 15 يومًا
جارٍ جمع السجل
خلال شهر
جارٍ جمع السجل

تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.

README.md

الأصل

CADomatic 🛠️

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
CADomatic Demo

CADomatic Fillet 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 .py scripts 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

CADomatic Current 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:

  1. User Input – Provide a design description as text.
  2. LLM Processing – The LLM generates a FreeCAD Python script.
  3. Model Creation – The script runs in FreeCAD (via CADomatic) to create a 3D model and render an image.
  4. Output – The final CAD file and preview image are returned to the user.

CADomatic Proposed Workflow
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:

  1. User Input – Provide a text description and optionally a reference keyword.
  2. Reference Image Input – Provide an optional reference image or a drafting of the desired CAD model.
  3. LLM Processing – The LLM generates a FreeCAD Python script.
  4. Model Creation & Rendering – CADomatic creates the 3D model and renders an image.
  5. Similarity Scoring – The rendered image is compared against reference images to compute a similarity score.
  6. 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

  • Python 3.11+
  • FreeCAD (must be installed and added to PATH)
  • uv (install via pip install uv)

⚙️ 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
# 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)

  1. Open FreeCAD (restart it after installing the addon).
  2. 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.
  3. In the CADomatic folder, run claude.
  4. Approve the project's freecad MCP server when asked.
  5. Type /mcp and check that freecad is connected.

4. Try it

  • "Explain how this project works."
  • /freecad-model make a flange with OD 100mm, bore 50mm, thickness 7.5mm and 6 M12 holes at PCD 75mm
  • /freecad-verify check 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.


استكشف مشاريع مشابهة ومرتبطة

جارٍ التحميل…