openscad
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseOpenSCAD Design Skill
OpenSCAD 设计技能
Create versioned OpenSCAD files, render previews, and compare iterations for 3D printing designs.
为3D打印设计创建带版本号的OpenSCAD文件、渲染预览图并对比迭代版本。
Workflow
工作流
1. Determine the Next Version Number
1. 确定下一个版本号
Before creating a new .scad file, find existing versions:
bash
.claude/skills/openscad/scripts/version-scad.sh <name>This returns the next version number and filename. For example, if exists, it returns .
piano_001.scadpiano_002在创建新的.scad文件前,先查找已有的版本:
bash
.claude/skills/openscad/scripts/version-scad.sh <name>该命令会返回下一个版本号和文件名。比如,如果已经存在,就会返回。
piano_001.scadpiano_0022. Create the Versioned .scad File
2. 创建带版本号的.scad文件
Write the OpenSCAD code to the versioned filename (e.g., ).
piano_002.scad将OpenSCAD代码写入对应版本号的文件中(例如)。
piano_002.scad3. Render the Preview
3. 渲染预览图
bash
.claude/skills/preview-scad/scripts/render-scad.sh <name>_<version>.scad --output <name>_<version>.pngThis creates a PNG with the matching version number (e.g., ).
piano_002.pngbash
.claude/skills/preview-scad/scripts/render-scad.sh <name>_<version>.scad --output <name>_<version>.png这会生成对应版本号的PNG图片(例如)。
piano_002.png4. Compare with Previous Version
4. 和上一个版本对比
Read both the current and previous PNG images to visually compare:
- Current:
piano_002.png - Previous: (if exists)
piano_001.png
Evaluate what changed and whether the new version better matches requirements.
读取当前版本和上一版本的PNG图片进行视觉对比:
- 当前版本:
piano_002.png - 上一版本:(如果存在的话)
piano_001.png
评估改动内容,以及新版本是否更符合需求。
5. Iterate
5. 迭代
If the design needs improvement:
- Analyze what's wrong
- Create the next version (e.g., )
piano_003.scad - Render and compare again
如果设计需要优化:
- 分析存在的问题
- 创建下一个版本(例如)
piano_003.scad - 再次渲染并对比
File Naming Convention
文件命名规范
<model-name>_<version>.scad -> <model-name>_<version>.pngExamples:
- ->
phone_stand_001.scadphone_stand_001.png - ->
phone_stand_002.scadphone_stand_002.png - ->
gear_001.scadgear_001.png
Use underscores in model names, and always use 3-digit zero-padded version numbers.
<model-name>_<version>.scad -> <model-name>_<version>.png示例:
- ->
phone_stand_001.scadphone_stand_001.png - ->
phone_stand_002.scadphone_stand_002.png - ->
gear_001.scadgear_001.png
模型名称中使用下划线,版本号统一使用3位补零的格式。
Example Session
示例使用流程
User asks for a piano model:
-
Check for existing versions:bash
.claude/skills/openscad/scripts/version-scad.sh pianoOutput:(no existing files)piano_001 -
Writewith initial design
piano_001.scad -
Render preview:bash
.claude/skills/preview-scad/scripts/render-scad.sh piano_001.scad --output piano_001.png -
Readto inspect the result
piano_001.png -
If improvements needed, create, render to
piano_002.scadpiano_002.png -
Read bothand
piano_001.pngto compare iterationspiano_002.png
用户需要一个钢琴模型:
-
检查已有的版本:bash
.claude/skills/openscad/scripts/version-scad.sh piano输出:(没有已存在的文件)piano_001 -
编写初始设计代码存入
piano_001.scad -
渲染预览图:bash
.claude/skills/preview-scad/scripts/render-scad.sh piano_001.scad --output piano_001.png -
读取检查设计结果
piano_001.png -
如果需要优化,创建,渲染生成
piano_002.scadpiano_002.png -
同时读取和
piano_001.png对比迭代差异piano_002.png
Render Options
渲染选项
See for full rendering options:
/preview-scad- - Image dimensions (default:
--size <WxH>)800x600 - - Camera position
--camera <x,y,z,tx,ty,tz,d> - - Color scheme (default:
--colorscheme <name>)Cornfield - - Full render mode (slower, more accurate)
--render - - Preview mode (faster, default)
--preview
完整的渲染选项可查看:
/preview-scad- - 图片尺寸(默认:
--size <WxH>)800x600 - - 相机位置
--camera <x,y,z,tx,ty,tz,d> - - 配色方案(默认:
--colorscheme <name>)Cornfield - - 完整渲染模式(速度较慢,精度更高)
--render - - 预览模式(速度更快,默认选项)
--preview
Next Steps
后续步骤
Once the design looks correct in PNG previews:
- Export to STL: Use to convert the final version to STL format
/export-stl - The export includes geometry validation to catch printability issues
当设计在PNG预览中看起来无误后:
- 导出为STL:使用将最终版本转换为STL格式
/export-stl - 导出过程会包含几何验证,以排查可打印性问题
Full Pipeline
完整流程
/openscad → /preview-scad → /export-stl (with validation)/openscad → /preview-scad → /export-stl (with validation)Tips
提示
- Start simple and add complexity in iterations
- Use meaningful model names that describe the object
- Keep each version's changes focused on specific improvements
- Document what changed between versions in your response to the user
- Only export to STL once the preview looks correct
- Always run slice-check before considering a model print-ready
- 从简单版本开始,迭代中逐步增加复杂度
- 使用能描述物体的、有意义的模型名称
- 每个版本的改动要聚焦于特定的优化点
- 在给用户的回复中记录版本之间的改动内容
- 仅在预览无误后再导出为STL
- 在判定模型可打印前务必运行切片检查