parse_cga
Parses CGA rule source into 3D glTF/glb models using CityEngine, applying attribute overrides and initial plot shapes, with reproducible seeds and downloadable output.
Instructions
用 CityEngine 引擎解析 CGA 规则源码,生成三维模型(glTF/glb)。
Args: cga_source: CGA 规则源码全文(手写或 generate_cga 的产物)。 attributes: CGA attr 覆盖,如 {"height": 30};键必须在规则的 attr 声明内。 initial_shape: 初始地块多边形 {"type":"Polygon","pts":[[x,z],...]},米制; 缺省用 30m x 20m 调试地块。 seed: 随机种子,固定后可复现结果。 download_glb: 是否把 glb 下载到本地(默认 True)。 output_dir: glb 落盘目录(默认环境变量 CITYENGINE_OUTPUT_DIR 或当前目录下 cityengine_mcp_output/)。 timeout_s: 轮询 job 的最长秒数(上限 300)。
Returns: job_id、模型统计(nodes/vertices/triangles/textures_embedded)、glb 本地路径、 签名下载地址(24h 有效)、sha256、计费用量、告警列表。
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"cga_source": "<cga_source>"
},
"name": "parse_cga"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| seed | No | ||
| timeout_s | No | ||
| attributes | No | ||
| cga_source | Yes | ||
| output_dir | No | ||
| download_glb | No | ||
| initial_shape | No |