subtract { A | B }
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
A, B | rule | — | A 为基础形状,B 为要减去的形状。 |
布尔差集操作。从形状 A 中减去形状 B 的体积,保留 A 中不与 B 重叠的部分。
差集操作:
Lot --> subtract { Box | Hole }
CGA.js 中的 subtract 实现基于 CityEngine 2025.1 官方文档。
@StartRule\nLot --> subtract { Box | Cyl }\n\nBox --> primitiveCube(4, 4, 4) color(0.8, 0.5, 0.5)\nCyl --> primitiveCylinder(16, 1.5, 6) color(0.5, 0.5, 0.8)