Skip to content
WyNo22Public

About

IA2CAD β€” AI-powered CAD assistant that turns natural language descriptions into 3D mechanical parts. Built with FastAPI, OpenAI GPT-4o-mini, CadQuery and Three.js. Features an interactive wizard for step-by-step part planning, real-time STL preview, face/edge selection, and auto-orientation of solids on the build plate. 🚧 Ongoing project.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

IA2CAD β€” AI-powered CAD Assistant

Describe a mechanical part in natural language β†’ get a 3D model.

Pipeline: User input β†’ GPT-4o-mini β†’ Structured JSON β†’ CadQuery β†’ STL β†’ Three.js viewer


Setup

1. Prerequisites

  • Python 3.10 or 3.11
  • pip

2. Install dependencies

cd backend
pip install -r requirements.txt

Note: CadQuery requires a compatible platform wheel. If installation fails, try:

conda install -c cadquery -c conda-forge cadquery

3. Configure API key

Create a .env file in the project root (next to backend/):

OPENAI_API_KEY=sk-proj-...

4. Run the server

cd backend
uvicorn main:app --reload --port 8000

5. Open the app

Navigate to http://localhost:8000


Usage

  1. Type a part description (e.g. "A cylinder 40mm diameter, 80mm tall")
  2. The AI may ask 1–3 clarifying questions
  3. Once confirmed, a 3D model appears in the viewer
  4. Iterate: "Make the hole bigger", "Add a flat base", etc.
  5. Download the STL with the Download STL button

Project Structure

IA2CAD/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ main.py            ← FastAPI app + routes
β”‚   β”œβ”€β”€ ai_service.py      ← OpenAI calls + JSON extraction
β”‚   β”œβ”€β”€ cad_generator.py   ← JSON β†’ CadQuery β†’ STL
β”‚   β”œβ”€β”€ session.py         ← in-memory session store
β”‚   β”œβ”€β”€ requirements.txt
β”‚   └── output/            ← generated STL files (auto-created)
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ index.html
β”‚   β”œβ”€β”€ app.js             ← chat + Three.js viewer
β”‚   └── style.css
β”œβ”€β”€ .env                   ← your API key (not committed)
β”œβ”€β”€ .env.example
└── README.md

Supported Part Features

Type Parameters
box width, depth, height (mm)
cylinder diameter, height (mm)
hole diameter, position [x, y] from center (mm)

All features are centered at origin. Holes are drilled along the Z-axis.

About

IA2CAD β€” AI-powered CAD assistant that turns natural language descriptions into 3D mechanical parts. Built with FastAPI, OpenAI GPT-4o-mini, CadQuery and Three.js. Features an interactive wizard for step-by-step part planning, real-time STL preview, face/edge selection, and auto-orientation of solids on the build plate. 🚧 Ongoing project.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages