openscad 3d model generator.com
openscad 3d model generator.com logo

OpenSCAD 3D Model Generator

Transforms natural language descriptions into parametric 3D models through a pipeline of image generation, object segmen...

Created byApr 22, 2025

OpenSCAD MCP Server

A Model Context Protocol (MCP) server that enables users to generate 3D models from text descriptions or images, with a focus on creating parametric 3D models using multi-view reconstruction and OpenSCAD.

Features

  • AI Image Generation: Generate images from text descriptions using Google Gemini or Venice.ai APIs
  • Multi-View Image Generation: Create multiple views of the same 3D object for reconstruction
  • Image Approval Workflow: Review and approve/deny generated images before reconstruction
  • 3D Reconstruction: Convert approved multi-view images into 3D models using CUDA Multi-View Stereo
  • Remote Processing: Process computationally intensive tasks on remote servers within your LAN
  • OpenSCAD Integration: Generate parametric 3D models using OpenSCAD
  • Parametric Export: Export models in formats that preserve parametric properties (CSG, AMF, 3MF, SCAD)
  • 3D Printer Discovery: Optional network printer discovery and direct printing

Architecture

The server is built using the Python MCP SDK and follows a modular architecture:

Installation

  1. Clone the repository:
  1. Create a virtual environment:
  1. Install dependencies:
  1. Install OpenSCAD:
  1. Install CUDA Multi-View Stereo:
  1. Set up API keys:

Remote Processing Setup

The server supports remote processing of computationally intensive tasks, particularly CUDA Multi-View Stereo reconstruction. This allows you to offload processing to more powerful machines within your LAN.

Server Setup (on the machine with CUDA GPU)

  1. Install CUDA Multi-View Stereo on the server machine:
  1. Start the remote CUDA MVS server:
  1. The server will automatically advertise itself on the local network using Zeroconf.

Client Configuration

  1. Configure remote processing in your .env file:
  1. Alternatively, you can specify a server URL directly:

Remote Processing Features

  • Automatic Server Discovery: Find CUDA MVS servers on your local network
  • Job Management: Upload images, track job status, and download results
  • Fault Tolerance: Automatic retries, circuit breaker pattern, and error tracking
  • Authentication: Secure API key authentication for all remote operations
  • Health Monitoring: Continuous server health checks and status reporting

Usage

  1. Start the server:
  1. The server will start on http://localhost:8000
  1. Use the MCP tools to interact with the server:

Image Generation Options

The server supports multiple image generation options:
  1. Google Gemini API (Default): Uses the Gemini 2.0 Flash Experimental model for high-quality image generation
  1. Venice.ai API (Optional): Alternative image generation service
  1. User-Provided Images: Skip image generation and use your own images

Multi-View Workflow

The server implements a multi-view workflow for 3D reconstruction:
  1. Image Generation: Generate multiple views of the same 3D object
  1. Image Approval: Review and approve/deny each generated image
  1. 3D Reconstruction: Convert approved images into a 3D model using CUDA MVS
  1. Model Refinement: Optionally refine the model using OpenSCAD

Remote Processing Workflow

The remote processing workflow allows you to offload computationally intensive tasks to more powerful machines:
  1. Server Discovery: Automatically discover CUDA MVS servers on your network
  1. Image Upload: Upload approved multi-view images to the remote server
  1. Job Processing: Process the images on the remote server using CUDA MVS
  1. Status Tracking: Monitor the job status and progress
  1. Result Download: Download the completed 3D model when processing is finished

Supported Export Formats

The server supports exporting models in various formats:
  • OBJ: Wavefront OBJ format (standard 3D model format)
  • STL: Standard Triangle Language (for 3D printing)
  • PLY: Polygon File Format (for point clouds and meshes)
  • SCAD: OpenSCAD source code (for parametric models)
  • CSG: OpenSCAD CSG format (preserves all parametric properties)
  • AMF: Additive Manufacturing File Format (preserves some metadata)
  • 3MF: 3D Manufacturing Format (modern replacement for STL with metadata)

Web Interface

The server provides a web interface for:
  • Generating and approving multi-view images
  • Previewing 3D models from different angles
  • Downloading models in various formats
Access the interface at http://localhost:8000/ui/

License

MIT

Contributing

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

OpenSCAD MCP Server

A Model Context Protocol (MCP) server that enables users to generate 3D models from text descriptions or images, with a focus on creating parametric 3D models using multi-view reconstruction and OpenSCAD.

Features

  • AI Image Generation: Generate images from text descriptions using Google Gemini or Venice.ai APIs
  • Multi-View Image Generation: Create multiple views of the same 3D object for reconstruction
  • Image Approval Workflow: Review and approve/deny generated images before reconstruction
  • 3D Reconstruction: Convert approved multi-view images into 3D models using CUDA Multi-View Stereo
  • Remote Processing: Process computationally intensive tasks on remote servers within your LAN
  • OpenSCAD Integration: Generate parametric 3D models using OpenSCAD
  • Parametric Export: Export models in formats that preserve parametric properties (CSG, AMF, 3MF, SCAD)
  • 3D Printer Discovery: Optional network printer discovery and direct printing

Architecture

The server is built using the Python MCP SDK and follows a modular architecture:

Installation

  1. Clone the repository:
  1. Create a virtual environment:
  1. Install dependencies:
  1. Install OpenSCAD:
  1. Install CUDA Multi-View Stereo:
  1. Set up API keys:

Remote Processing Setup

The server supports remote processing of computationally intensive tasks, particularly CUDA Multi-View Stereo reconstruction. This allows you to offload processing to more powerful machines within your LAN.

Server Setup (on the machine with CUDA GPU)

  1. Install CUDA Multi-View Stereo on the server machine:
  1. Start the remote CUDA MVS server:
  1. The server will automatically advertise itself on the local network using Zeroconf.

Client Configuration

  1. Configure remote processing in your .env file:
  1. Alternatively, you can specify a server URL directly:

Remote Processing Features

  • Automatic Server Discovery: Find CUDA MVS servers on your local network
  • Job Management: Upload images, track job status, and download results
  • Fault Tolerance: Automatic retries, circuit breaker pattern, and error tracking
  • Authentication: Secure API key authentication for all remote operations
  • Health Monitoring: Continuous server health checks and status reporting

Usage

  1. Start the server:
  1. The server will start on http://localhost:8000
  1. Use the MCP tools to interact with the server:

Image Generation Options

The server supports multiple image generation options:
  1. Google Gemini API (Default): Uses the Gemini 2.0 Flash Experimental model for high-quality image generation
  1. Venice.ai API (Optional): Alternative image generation service
  1. User-Provided Images: Skip image generation and use your own images

Multi-View Workflow

The server implements a multi-view workflow for 3D reconstruction:
  1. Image Generation: Generate multiple views of the same 3D object
  1. Image Approval: Review and approve/deny each generated image
  1. 3D Reconstruction: Convert approved images into a 3D model using CUDA MVS
  1. Model Refinement: Optionally refine the model using OpenSCAD

Remote Processing Workflow

The remote processing workflow allows you to offload computationally intensive tasks to more powerful machines:
  1. Server Discovery: Automatically discover CUDA MVS servers on your network
  1. Image Upload: Upload approved multi-view images to the remote server
  1. Job Processing: Process the images on the remote server using CUDA MVS
  1. Status Tracking: Monitor the job status and progress
  1. Result Download: Download the completed 3D model when processing is finished

Supported Export Formats

The server supports exporting models in various formats:
  • OBJ: Wavefront OBJ format (standard 3D model format)
  • STL: Standard Triangle Language (for 3D printing)
  • PLY: Polygon File Format (for point clouds and meshes)
  • SCAD: OpenSCAD source code (for parametric models)
  • CSG: OpenSCAD CSG format (preserves all parametric properties)
  • AMF: Additive Manufacturing File Format (preserves some metadata)
  • 3MF: 3D Manufacturing Format (modern replacement for STL with metadata)

Web Interface

The server provides a web interface for:
  • Generating and approving multi-view images
  • Previewing 3D models from different angles
  • Downloading models in various formats
Access the interface at http://localhost:8000/ui/

License

MIT

Contributing

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