openscad
Create and render OpenSCAD 3D models. Generate preview images from multiple angles, extract customizable parameters, validate syntax, and export STL files for 3D printing platforms like MakerWorld.
By mitsuhiko · 878 installs
npx skills add mitsuhiko/agent-stuff --skill openscad
Source repository · Upstream listing
OpenSCAD Skill
Create, validate, and export OpenSCAD 3D models. Supports parameter customization, visual preview from multiple angles, and STL export for 3D printing platforms like MakerWorld.
Prerequisites
OpenSCAD must be installed. Install via Homebrew:
Tools
This skill provides several tools in the tools/ directory:
Preview Generation
STL Export
Parameter Extraction
Validation
Visual Validation (Required)
Always validate your OpenSCAD models visually after creating or modifying them.
After writing or editing any OpenSCAD file:
1. Generate multi angle previews using multi preview.sh
2. View each generated image using the read tool
3. Check for issues from multiple perspectives:
Front/back: Verify symmetry, features, and proportions
Left/right: Check depth and side profiles
Top: Ensure top features are correct
Isometric: Overall shape validation
4. Iterate if needed : If something looks wrong, fix the code and re validate
This catches issues that syntax validation alone cannot detect:
Inverted normals or inside out geometry
Misaligned features or incorrect boolean operations
Proportions that don't match the intended design
Missing or floating geometry
Z fighting or overlapping surfaces
Never deliver an OpenSCAD model without visually confirming it looks correct from multiple angles.
Workflow
1. Creating an OpenSCAD Model
Write OpenSCAD code with customizable parameters at the top:
Parameter comment format:
// [min:max] numeric range
// [min:step:max] numeric range with step
// [opt1, opt2, opt3] dropdown options
// Description text plain description
2. Validate the Model
3. Generate Previews
Generate preview images to visually validate the model:
This creates PNG images from multiple angles. Use the read tool to view them.
4. Export to STL
Camera Positions
Common camera angles for previews:
Isometric : camera=0,0,0,45,0,45,200
Front : camera=0,0,0,90,0,0,200
Top : camera=0,0,0,0,0,0,200
Right : camera=0,0,0,90,0,90,200
Format: x,y,z,rotx,roty,rotz,distance
MakerWorld Publishing
For MakerWorld, you typically need:
1. STL file(s) exported via export stl.sh
2. Preview images (at least one good isometric view)
3. A description of customizable parameters
Consider creating a model.json with metadata:
Example: Full Workflow
Remember : Never skip the visual validation step. Many issues (wrong dimensions, boolean operation errors, inverted geometry) are only visible when you actually look at the rendered model.
OpenSCAD Quick Reference
Basic Shapes
Transformations
Boolean Operations
Advanced
2D Shapes