skylersaucedo
MCP Serverskylersaucedopublic

2d_3d

通过分析物体的三个正交视图,使用Claude AI生成STL格式的3D模型。

Repository Info

0
Stars
0
Forks
0
Watchers
0
Issues
Python
Language
-
License

About This Server

通过分析物体的三个正交视图,使用Claude AI生成STL格式的3D模型。

Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.

Documentation

2D to 3D Model Generator

This project uses Claude AI to analyze three orthographic views of an object and generate a 3D model in STL format using OpenSCAD.

Test Example

Input Images

The project includes three test images in sample_images/ showing different views of a mechanical part:

  1. Front/Side View (side1.jpg, 13KB):

    • Height: 75 units
    • Width: 50 units
    • Features a rounded corner (R35) on the top right
    • Contains horizontal section markers
  2. Top/Bottom View (side2.jpg, 11KB):

    • Width: 50 units
    • Height: 35 units (partial)
    • Shows vertical dividing line
    • Contains corresponding section markers
  3. Side View with Hole (side3.jpg, 17KB):

    • Height: 75 units
    • Width: 60 units
    • Features a circular hole (Ø25 units)
    • Shows section markers

Generated 3D Model

The system generates three output files in the output/ directory:

  1. OpenSCAD Source (model.scad, 645B):

    • Contains the parametric 3D model definition
    • Uses CSG operations for the main shape
    • Implements the rounded corner and cylindrical hole
  2. STL Model (output.stl, 21KB):

    • Final 3D model ready for viewing or 3D printing
    • Represents a block with dimensions: 60x50x75 units
    • Features:
      • Rounded corner (R35) on one edge
      • Cylindrical hole (Ø25) through part of the body
  3. Dimensions File (output.brep):

    • Contains the extracted dimensions in text format
    • Records width: 60, height: 75, depth: 50

Setup and Usage

  1. Install dependencies:
pip install -r requirements.txt
  1. Install OpenSCAD from https://openscad.org/downloads.html

  2. Set up your environment variables:

ANTHROPIC_API_KEY=your_api_key_here
  1. Run the test script:
python test_generation.py

The script will:

  1. Load the three sample images
  2. Send them to Claude for analysis
  3. Generate OpenSCAD code based on the analysis
  4. Create an STL file using OpenSCAD

Project Structure

.
├── sample_images/          # Input test images
│   ├── side1.jpg          # Front/Side view
│   ├── side2.jpg          # Top/Bottom view
│   └── side3.jpg          # Side view with hole
├── output/                 # Generated files
│   ├── model.scad         # OpenSCAD source
│   ├── output.stl         # 3D model
│   └── output.brep        # Dimensions
├── claude_mcp_builder.py  # Main implementation
├── test_generation.py     # Test script
└── requirements.txt       # Python dependencies

Dependencies

  • FastAPI
  • Uvicorn
  • Python-multipart
  • Python-dotenv
  • Anthropic
  • OpenSCAD (external software)

Viewing the 3D Model

You can view the generated STL file using:

  1. OpenSCAD itself
  2. Online viewers like ViewSTL
  3. 3D printing slicers like Cura or PrusaSlicer
  4. CAD software like FreeCAD or Fusion 360

Quick Start

1

Clone the repository

git clone https://github.com/skylersaucedo/2d_3d
2

Install dependencies

cd 2d_3d
npm install
3

Follow the documentation

Check the repository's README.md file for specific installation and usage instructions.

Repository Details

Ownerskylersaucedo
Repo2d_3d
LanguagePython
License-
Last fetched8/10/2025

Recommended MCP Servers

💬

Discord MCP

Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.

integrationsdiscordchat
🔗

Knit MCP

Connect AI agents to 200+ SaaS applications and automate workflows.

integrationsautomationsaas
🕷️

Apify MCP Server

Deploy and interact with Apify actors for web scraping and data extraction.

apifycrawlerdata
🌐

BrowserStack MCP

BrowserStack MCP Server for automated testing across multiple browsers.

testingqabrowsers

Zapier MCP

A Zapier server that provides automation capabilities for various apps.

zapierautomation