splitArea(axis) { area1 : operation1 | area2 : operation2 | ... }
splitArea(axis) { area1 : operation1 | area2 : operation2 | ... }*
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
axis | selector | — | 分割轴:x、y 或 z。 |
area | float | — | 每个片段的目标面积。 |
按面积分割当前形状。与 split 不同,splitArea 按目标面积而非固定尺寸进行分割。常用于按楼层面积划分建筑。
按 X 轴面积分割:
Lot --> splitArea(x) { 20 : Floor1 | 30 : Floor2 | remainder : Floor3 }
重复模式:
Lot --> splitArea(y) { 10 : Floor }*
splitArea( 时,补全列表显示:CGA.js 中的 splitArea 实现基于 CityEngine 2025.1 官方文档。
@StartRule
Lot --> primitiveCube(8, 0.2, 6)
splitArea(x) { 20 : Left | 30 : Center | remainder : Right }
Left --> color(1, 0, 0)
Center --> color(0, 1, 0)
Right --> color(0, 0, 1)