shapeL, shapeU, shapeO


 

Synopsis概念 L、 U、 O 地块造型

类型一:shapeL(frontWidth, leftWidth) { selector operator operations | selector operator
operations }

类型二:shapeU(frontWidth, rightWidth, leftWidth) { selector operator operations | selector operator operations }

类型三:shapeO(frontWidth, rightWidth, backWidth, leftWidth) { selector operator operations | selector operator operations }

Parameters参数

frontWidth (float)
Depth of front wing.
leftWidth (float)
Width of left wing.
rightWidth (float)
Width of right wing.
backWidth (float)
Depth of rear wing.
selector (keyword)
Semantic selection keyword:
shape: The setback polygon (i.e. the L,U or O shape)
remainder: Selects the remainder of the polygon.
operator
The operator defines how the setback polygons are used to generate successor shapes.

This also applies to shapes with more than one faces. Valid operators are:
: Each polygon is put into a new shape.
= All polygons corresponding to the selector are combined into one new shape.
operations
A sequence of CGA operations to execute.
frontWidth(浮点)
前部宽度。
leftWidth(浮点)
左侧宽度。
rightWidth(浮点)
右侧宽度。
backWidth(浮点)
后部宽度。
选择器(关键字)
语义选择关键字:
形状:挫折多边形(即L,U或O型)
余:选择的多边形的剩余部分。
操作者
操作定义了挫折多边形用来产生继任的形状。这也适用于形状具有一个以上的面。有效的运算符有:
:每个多边形被放入一个新的形状。
=对应于所述选择器的所有多边形合并成一个新的形状。
操作
CGA操作顺序来执行。

练习案例

QQ截图20160531092108

Lot-->  
    shapeL(5,9) { shape :A | remainder: B. }  
A-->  
    extrude(15)  
    color("#ff0000")  
    
B.-->
   extrude(5)
   color(0,0,1,0.5)

 

 

 

官方提供的案例

L-Shapes

shapL01
A block filled with L-shapes.

 

attr FrontDepth = 5
attr LeftWidth = 11
	
Lot -->
    offset(-3, inside)
    shapeL(FrontDepth,LeftWidth) { shape : Footprint | remainder: NIL }
	
Footprint -->
    extrude(rand(5,12)) color(1,0,0)

 

 

U-Shapes

shapU01
A block filled with U-shapes.

attr FrontDepth = 5
attr RightWidth = 3
attr LeftWidth = 11


		
Lot -->
    offset(-3, inside)
    shapeU(FrontDepth,RightWidth,LeftWidth) { shape : Footprint | remainder: NIL }
	
Footprint -->
    extrude(rand(10,20)) color(1,0,0)

 

O-Shapes

shapO01
A block filled with O-shapes.

attr FrontDepth = 5
attr RightWidth = 3
attr BackDepth = 2
attr LeftWidth = 11

		
LotInner -->
    Lot
        
Lot -->
    offset(-3, inside)
    shapeO(FrontDepth,RightWidth,BackDepth,LeftWidth) { shape : Footprint | remainder: NIL }

Footprint -->
    extrude(rand(10,20)) color(1,0,0)

 


《shapeL, shapeU, shapeO》有3个想法

    1. 可以看这篇文章http://cityengine.cn/archives/4722其实L、U、O的效果都有,但是不是你想要的效果,想一下其它函数,解决不了在讨论。祝好!阿门

发表评论

电子邮件地址不会被公开。 必填项已用*标注