创建孔洞:
Lot-->extrude(10)
split(x){ { ~1 : X | ~1 : NIL }* | ~1 : X }
创建孔洞:
Lot-->extrude(10)
split(x){ { ~1 : X | ~1 : NIL }* | ~1 : X } 注:删除分割对象(Leaf)的挂接。
终止递归:
attr minheight = 10 attr maxheight = 30 attr ErkerFact = 0.8 attr ErkerDepth = 0.8 attr ErkerStop = 2 Lot--> extrude(10) X
comp(f) { top : Erker } Erker-->
case(scope.sx > ErkerStop) : s('ErkerFact, 'ErkerFact, 0) center(xy)
alignScopeToGeometry(yUp, 0) extrude(ErkerDepth) X
comp(f){top : Erker} else: NIL
Offset
attr red = \attr green = \Lot -->
offset(-3) A //注:默认选择是all。 A -->
comp(f) { inside: I | border: O } I --> color(red) extrude(15) O --> color(green) extrude(10)
attr red = \attr green = \Lot -->
offset(-3,inside) A A -->
extrude (10) color(red)
(这里的正负号指的都是方向)
attr red = \attr green = \Lot -->
offset(-3,border) A A -->
extrude (10) color(green)
Report
概要:定义关键字生成报告
report(key, value)
参数:key (string)
报告收集的关键字,关键字可以使用“.”分组。Keys can be grouped with the name sparator ''.'' value (float | bool | string)
Value (or variable / shape attribute) to add to the collection.
示例
version \ Lot --> extrude(30)
comp(f) { side : Facade | top : Roof } Facade -->
report(\, 1) //注:统计侧面个数 split(y) { ~5 : Floor | ~0.5 : Ledge }* Floor -->
split(x) { ~1 : Tile | 2 : Window | ~1 : Tile}* Window --> 40%:
report(\, geometry.area())// 注: 统计窗口面积 report(\, 1) //注:统计窗户敞开的个数 NIL else:
report(\, geometry.area()) //注:统计窗口面积 report(\, 1)// 注:统计窗户关闭的个数 color(\)