鱼皮AI导航
鱼皮AI导航
  • 主页
  • 社区
  • AI工具
  • AI知识库
  • AI提示词
  • MCP
  • Skills
  • AI学习资源
  • AI资讯
  • GitHub开源
登录/注册

openscad

生成并验证 OpenSCAD 3D 模型,支持多角度预览、参数提取与 STL 导出,确保设计符合打印要求,适用于 MakerWorld 等平台的发布准备。

生活方式
访问 GitHub
文档Skills.MD
name
openscad
description
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.

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:

▼
bash
复制代码
brew install openscad

Tools

This skill provides several tools in the tools/ directory:

Preview Generation

▼
bash
复制代码
# Generate a single preview image ./tools/preview.sh model.scad output.png [--camera=x,y,z,tx,ty,tz,dist] [--size=800x600] # Generate multi-angle preview (front, back, left, right, top, iso) ./tools/multi-preview.sh model.scad output_dir/

STL Export

▼
bash
复制代码
# Export to STL for 3D printing ./tools/export-stl.sh model.scad output.stl [-D 'param=value']

Parameter Extraction

▼
bash
复制代码
# Extract customizable parameters from an OpenSCAD file ./tools/extract-params.sh model.scad

Validation

▼
bash
复制代码
# Check for syntax errors and warnings ./tools/validate.sh model.scad

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:

▼
openscad
复制代码
// Customizable parameters wall_thickness = 2; // [1:0.5:5] Wall thickness in mm width = 50; // [20:100] Width in mm height = 30; // [10:80] Height in mm rounded = true; // Add rounded corners // Model code below module main_shape() { if (rounded) { minkowski() { cube([width - 4, width - 4, height - 2]); sphere(r = 2); } } else { cube([width, width, height]); } } difference() { main_shape(); translate([wall_thickness, wall_thickness, wall_thickness]) scale([1 - 2*wall_thickness/width, 1 - 2*wall_thickness/width, 1]) main_shape(); }

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

▼
bash
复制代码
./tools/validate.sh model.scad

3. Generate Previews

Generate preview images to visually validate the model:

▼
bash
复制代码
./tools/multi-preview.sh model.scad ./previews/

This creates PNG images from multiple angles. Use the read tool to view them.

4. Export to STL

▼
bash
复制代码
./tools/export-stl.sh model.scad output.stl # With custom parameters: ./tools/export-stl.sh model.scad output.stl -D 'width=60' -D 'height=40'

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:

▼
json
复制代码
{ "name": "Model Name", "description": "Description for MakerWorld", "parameters": [...], "tags": ["functional", "container", "organizer"] }

Example: Full Workflow

▼
bash
复制代码
# 1. Create the model (write .scad file) # 2. Validate syntax ./tools/validate.sh box.scad # 3. Generate multi-angle previews ./tools/multi-preview.sh box.scad ./previews/ # 4. IMPORTANT: View and validate ALL preview images # Use the read tool on each PNG file to visually inspect: # - previews/box_front.png # - previews/box_back.png # - previews/box_left.png # - previews/box_right.png # - previews/box_top.png # - previews/box_iso.png # Look for geometry issues, misalignments, or unexpected results. # If anything looks wrong, go back to step 1 and fix it! # 5. Extract and review parameters ./tools/extract-params.sh box.scad # 6. Export STL with default parameters ./tools/export-stl.sh box.scad box.stl # 7. Export STL with custom parameters ./tools/export-stl.sh box.scad box_large.stl -D 'width=80' -D 'height=60'

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

▼
openscad
复制代码
cube([x, y, z]); sphere(r = radius); cylinder(h = height, r = radius); cylinder(h = height, r1 = bottom_r, r2 = top_r); // cone

Transformations

▼
openscad
复制代码
translate([x, y, z]) object(); rotate([rx, ry, rz]) object(); scale([sx, sy, sz]) object(); mirror([x, y, z]) object();

Boolean Operations

▼
openscad
复制代码
union() { a(); b(); } // combine difference() { a(); b(); } // subtract b from a intersection() { a(); b(); } // overlap only

Advanced

▼
openscad
复制代码
linear_extrude(height) 2d_shape(); rotate_extrude() 2d_shape(); hull() { objects(); } // convex hull minkowski() { a(); b(); } // minkowski sum (rounding)

2D Shapes

▼
openscad
复制代码
circle(r = radius); square([x, y]); polygon(points = [[x1,y1], [x2,y2], ...]); text("string", size = 10);
生活方式

快捷安装

复制到终端去安装 Skill

npxskillsaddmitsuhiko/agent-stuff--skill"openscad"
站长:程序员鱼皮 老鱼简历 商务合作 增值电信业务经营许可证
2026 鱼皮AI导航 | 沪ICP备19026706号-6
站长:程序员鱼皮 老鱼简历 商务合作 增值电信业务经营许可证
2026 鱼皮AI导航 | 沪ICP备19026706号-6
🔥热门工具
朱雀AI检测朱雀AI检测
朱雀AI检测助手朱雀AI检测助手
LovartLovart
老鱼简历老鱼简历
WritePass官网WritePass官网
面多多面多多
CursorCursor
星月写作星月写作
朱雀AI检测助手朱雀AI检测助手
零感AI零感AI
Skills 推荐
explicit-identity
在跨进程或异步边界时确保身份可追溯,通过全程显式传递唯一标识符(如 UUID)来避免依赖隐式状态或“最新”概念引发的竞争条件,严格区分不同语义的 ID 类型并各自独立管理。
sympy
提供符号数学计算能力,支持代数方程求解、微积分运算、表达式化简、符号矩阵运算、物理建模、数论分析、几何推导及公式转代码等功能,适用于需要精确解析解而非数值近似的所有数学场景。
secret-scanner
自动识别和检测代码或配置文件中可能泄露的敏感信息,如密钥、令牌、密码等,并提供修复建议与安全配置方案,支持开发流程中的早期风险防控。
propositional-logic
通过形式化方法分析命题逻辑结构,利用真值表枚举、自然演绎推理与语义 tableau 构造判断公式性质,实现对可满足性、永真性及逻辑蕴涵的系统性判定,适用于数学逻辑中的命题推理问题求解。
chinese-writing
掌握现代简体中文内容创作的核心方法,专注于生成温暖自然、清晰易读的周刊、博客与科技资讯类文章,强调以读者为中心的表达、简洁有力的句式、合理的结构排版及中英文混排规范,适用于需要专业语感与传播效果的内容生产场景。