Grasshopper Generator
/install grasshopper-generator
Grasshopper Generator
Generate Rhino 7 Grasshopper (.ghx) files programmatically.
Workflow
1. Analyze Input
Image → Identify form (tower/dome/surface/facade), key features (twist/array/voronoi/diagrid), proportions. Text → Parse the same from description.
2. Design the Graph
Sliders → Geometry → Transforms → Booleans → Output
Component priority:
- Native GH components (see
references/component_guids.jsonfor 152 known GUIDs) - GhPython Script for complex custom logic
- Third-party plugins only when explicitly requested
Common patterns:
| Form | Key Components |
|---|---|
| Twisted tower | Rectangle → Rotate → Extrude → Series |
| Curved facade | Curve → Divide → Orient → Surface |
| Voronoi | Populate 2D → Voronoi → Boundary Surfaces |
| Diagrid | Hexagonal → Scale → Loft |
| Dome | Circle → Rotate → Sweep1 |
| Custom logic | GhPython Script |
3. Generate .ghx
import sys; sys.path.insert(0, 'SKILL_DIR/scripts')
from ghx_generator import GHXGenerator
gen = GHXGenerator("Definition Name", "Description")
r = gen.add_slider("Radius", 20, 1, 100, x=50, y=50)
c = gen.add_component("Circle", inputs=["Base Plane", "Radius"], outputs=["Circle"], x=300, y=50)
gen.connect(r, "output", c, "Radius")
gen.save("output.ghx")
4. GhPython Fallback
For complex geometry not achievable with native components:
py = gen.add_python("Custom", code, inputs=["x", "y"], outputs=["a"], x=300, y=200)
GhPython has full Rhino.Geometry API. Input variables available by name. Assign a = result for output.
5. Deliver
Save .ghx and send to user. Note adjustable parameters (sliders), definition purpose, and any plugin dependencies.
File Locations
- Generator:
scripts/ghx_generator.py— full API withadd_slider,add_component,add_python,connect,save - GUID database:
references/component_guids.json— 152 authentic component GUIDs extracted from real .gh files - Reference template:
references/template_voronoi.ghx— real Grasshopper file for structural reference
Notes
- Output is .ghx (XML), fully compatible with Rhino 7
- All GUIDs extracted from real Grasshopper installations
- For components not in the database, GhPython Script handles everything
- Supports wiring via
connect(source_ref, source_param, target_ref, target_param)
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install grasshopper-generator - 安装完成后,直接呼叫该 Skill 的名称或使用
/grasshopper-generator触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Grasshopper Generator 是什么?
Generate Rhino 7 Grasshopper (.ghx) XML files from natural language descriptions or images. Build parametric definitions with native GH components, GhPython... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 98 次。
如何安装 Grasshopper Generator?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install grasshopper-generator」即可一键安装,无需额外配置。
Grasshopper Generator 是免费的吗?
是的,Grasshopper Generator 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Grasshopper Generator 支持哪些平台?
Grasshopper Generator 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Grasshopper Generator?
由 ElliotBian(@elliotbian)开发并维护,当前版本 v1.0.0。