Skip to content

Delta-Prime-Robotics/onshape-chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Onshape Chat

Natural language interface for Onshape CAD. Create 3D models by describing what you want in plain English.

Features

  • 🎨 Natural Language Interface - Describe what you want to build
  • 🔧 CAD Operations - Create documents, sketches, and 3D features
  • 💬 Interactive Chat - Rich terminal interface with conversation memory
  • 🤖 LLM-Powered - Uses GLM with function calling for reliable operation

Installation

Prerequisites

  • Python 3.12 or higher
  • Onshape API credentials
  • GLM API key

Setup

  1. Clone the repository:
git clone https://github.com/yourusername/onshape-chat.git
cd onshape-chat
  1. Install dependencies:
pip install -e .
  1. Configure environment variables:
cp .env.example .env

Edit .env and add your credentials:

GLM_API_KEY=your-glm-api-key
ONSHAPE_ACCESS_KEY=your-onshape-access-key
ONSHAPE_SECRET_KEY=your-onshape-secret-key

Usage

Start the chat interface:

onshape-chat

Example Conversation

You: Create a document called "My First Part"
Assistant: Created document 'My First Part' (ID: abc123...)

You: Make a rectangle 50mm wide and 30mm tall on the XY plane
Assistant: Created rectangular sketch (50mm × 30mm) on XY plane

You: Extrude it 20mm
Assistant: Extruded sketch to depth of 20.0mm forward

You: Show me what it looks like
Assistant: Opening your document in Onshape...

Commands

  • /help - Show help message
  • /quit or /exit - Exit the chat
  • /clear - Clear conversation history
  • /state - Show current document state

Development

Running Tests

pytest tests/

Code Formatting

black src/
ruff check src/

Project Structure

onshape-chat/
├── src/onshape_chat/
│   ├── config.py           # Configuration management
│   ├── main.py             # Entry point
│   ├── llm/                # LLM integration
│   ├── onshape/            # Onshape API client
│   ├── tools/              # Tool implementations
│   └── ui/                 # Chat interface
├── docs/                   # Documentation
└── tests/                  # Tests

Roadmap

See PLAN.md for the full development plan.

Phase 1 (Current)

  • ✅ Basic scaffolding
  • ✅ Onshape API client
  • ✅ Document management
  • ✅ Basic sketches (rectangle, circle)
  • ✅ Extrude operation
  • ✅ LLM integration
  • ✅ CLI chat interface

Phase 2 (Next)

  • Advanced sketch primitives
  • Sketch on face
  • Fillet and chamfer
  • Boolean operations
  • Patterns
  • Revolve
  • Measurement queries

Phase 3

  • Assembly operations
  • Export (STL, STEP)
  • Terminal graphics
  • Error recovery
  • Undo support

Phase 4

  • Web UI
  • Voice input
  • Image import
  • Parametric templates

Contributing

Contributions welcome! Please feel free to submit a Pull Request.

License

MIT License - see LICENSE file for details

Acknowledgments

About

a way to bulid with onshape using plain english

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages