1、comp( ){ } operator
comp( compSelector ){ selector operator operations | … }
参数:
compSelector–关键字
f – faces.
e – edges.
fe --face edges
v – vertices
g – groups
m – materials
h – holes
selector–关键字
(1) { front | back | left | right | top | bottom }
官方解释:The y-normals of the components are analyzed by classifying their directions into the corresponding quadrants (in relation to the local coordinate system of the current shape.---------------------------------------局部坐标系
个人理解:该关键字是为了将所建立方体的每个平面(组件)单独分割成一个可进一步规则化的组件(对象)
例如如下:
version "2016.0"
@startrule
Lot-->
extrude(100)
//color(0,128,0)
//Building
Building2
Building2-->
comp(f){front:frontFaced|back:backfaced|left:leftfaced|right:rightfaced|top:topfaced|bottom:bottomfaced}
frontFaced-->
color(1,1,1)
backfaced-->
color(0,0,0)
leftfaced-->
color(1,1,0)
rightfaced-->
color(1,0,1,0.5)
topfaced-->
color(1,0,0,0.5)
bottomfaced-->
color(1,0,1)
规则化后的模型样子如下所示:
(2){ object.front | object.back | object.left | object.right | object.top | object.bottom | object.side}
官方解释:The y-normals of the components are analyzed by classifying their directions into the corresponding quadrants (in relation to the object coordinate system of the current initial shape.-------------------------目标对象物体坐标系
个人理解:
规则代码如下:
Lot-->
//envelope(normal, maxHeight, frontBaseHeight, frontAngle, backBaseHeight, backAngle, sideBaseHeight, sideAngle,leftBasedHeight,leftAngle)
extrude(20)
//color(0,1,1,0.3)
building
building-->
comp(f){ object.front:frontfaced | object.back:backfaced | object.left:leftfaced | object.right:rightfaced | object.top:topfaced | object.bottom:bottomfaced | object.side:sidefaced}
frontfaced-->
color("#EE82EE")
backfaced-->
color(0,1,1,0.5)
leftfaced-->
color(0,0,1,0.2)
rightfaced-->
color("#4B0082")
topfaced-->
color("#191970")
bottomfaced-->
color("#7FFFAA")
sidefaced-->
color("#FFFF00")
规则化后的模型如下所示: