← 返回
未分类

Grasshopper Generator

Generate Rhino 7 Grasshopper (.ghx) XML files from natural language descriptions or images. Build parametric definitions with native GH components, GhPython...
从自然语言描述或图像生成 Rhino 7 Grasshopper (.ghx) XML 文件,使用原生 GH 组件和 GhPython 构建参数化定义。
elliotbian
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 1
Stars
📥 337
下载
💾 0
安装
1
版本
#latest

概述

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:

  1. Native GH components (see references/component_guids.json for 152 known GUIDs)
  2. GhPython Script for complex custom logic
  3. Third-party plugins only when explicitly requested

Common patterns:

FormKey Components
---------------------
Twisted towerRectangle → Rotate → Extrude → Series
Curved facadeCurve → Divide → Orient → Surface
VoronoiPopulate 2D → Voronoi → Boundary Surfaces
DiagridHexagonal → Scale → Loft
DomeCircle → Rotate → Sweep1
Custom logicGhPython 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 with add_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)

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-07 14:55 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,358 📥 318,360
security-compliance

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,215 📥 266,531
developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 668 📥 324,156