Generate 3D-printable STL files from plain text descriptions using AI (Claude via AWS Bedrock).
- Install dependencies:
pip install -r requirements.txt
- Configure AWS credentials:
- Use
aws configureor create a.envfile:AWS_ACCESS_KEY_ID=your-access-key AWS_SECRET_ACCESS_KEY=your-secret-key AWS_DEFAULT_REGION=us-east-1
- Use
- (Optional) Install OpenSCAD:
- For automatic STL conversion: openscad.org
python main.pyThen open http://localhost:8000 in your browser.
- Enter a description of a 3D object in the web UI
- The app uses Claude (via AWS Bedrock) to generate OpenSCAD code
- The code is converted to an STL file for 3D printing
- Download both
.scadand.stlfiles from the browser
- Python 3.8+
- AWS account with Bedrock access
- OpenSCAD (optional, for STL conversion)
- Generate models:
- Enter a description like "a simple cube with 10mm sides"
- Optionally select an AWS region
- Click "Generate STL File"
- Download the generated .scad and .stl files
- "a cylinder with diameter 20mm and height 30mm"
- "a sphere with radius 15mm"
- "a gear with 12 teeth, 30mm outer diameter"
- "an L-shaped bracket with 50mm legs and 5mm thickness"
- "a phone stand with 60 degree viewing angle"
- Text Input: You provide a natural language description of the 3D object
- AI Processing: AWS Bedrock with Claude interprets your description and generates OpenSCAD code
- Code Generation: Valid OpenSCAD code is created with appropriate parameters
- STL Conversion: The OpenSCAD code is compiled to an STL file (if OpenSCAD is installed)
- Output: You get both the
.scadfile (editable) and.stlfile (3D printable)
For each generation, you'll get:
.stlfile: The 3D model ready for slicing and printing.scadfile: The OpenSCAD source code, which you can edit manually
- "cube 10mm"
- "cylinder height 20mm diameter 10mm"
- "sphere radius 15mm"
- "a phone stand with 60 degree angle"
- "a cable organizer with 5 slots"
- "a mounting bracket with screw holes"
- "a dice with rounded corners"
- "a snowflake ornament"
- "a vase with hexagonal pattern"
- Be Specific: Include dimensions when possible (e.g., "10mm sides" instead of "small")
- Use Standard Shapes: Reference common 3D shapes (cube, cylinder, sphere, cone, etc.)
- Mention Key Features: Specify holes, slots, fillets, chamfers, etc.
- Iterate: If the first result isn't perfect, edit the generated
.scadfile or try a more detailed description
If you see this warning, the tool will still generate the .scad file. You can:
- Install OpenSCAD from openscad.org
- Open the
.scadfile manually in OpenSCAD - Export to STL from OpenSCAD's File menu
Make sure your AWS credentials are configured:
aws configure
# or
export AWS_ACCESS_KEY_ID='your-access-key'
export AWS_SECRET_ACCESS_KEY='your-secret-key'- Check the
.scadfile and edit it manually - Try a more detailed or different description
- The AI might need more specific dimensions or constraints
boto3>=1.28.0- AWS SDK for Python (includes Bedrock client)python-dotenv>=1.0.0- Environment variable managementfastapi>=0.104.0- Web frameworkuvicorn>=0.24.0- ASGI serverjinja2>=3.1.0- Template engine
Contributions are welcome! Feel free to:
- Report bugs
- Suggest features
- Submit pull requests
This project is open source. Feel free to use and modify as needed.
Made with ❤️ for makers and 3D printing enthusiasts