CityEngine學習筆記(一)——shapeL

Synopsis 概要

具體語法

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.

The shapeL, shapeU, shapeO operations select a number of edges, depending on predefined spatial selectors, and set them back by a user-defined distance.

Related

Examples

L-Shapes


A block filled with L-shapes.

 

attr myFrontDepth = 5
attr myLeftWidth = 11

LotInner -->
    Lot
		
Lot -->
    offset(-3, inside)
    shapeL(myFrontDepth,myLeftWidth) { shape : Footprint | remainder: NIL }
	
Footprint -->
    extrude(rand(10,20)) color(1,0,0)
  

U-Shapes


A block filled with U-shapes.

attr myFrontDepth = 5
attr myRightWidth = 3
attr myLeftWidth = 11


LotInner -->
    Lot
		
Lot -->
    offset(-3, inside)
    shapeU(myFrontDepth,myRightWidth,myLeftWidth) { shape : Footprint | remainder: NIL }
	
Footprint -->
    extrude(rand(10,20)) color(1,0,0)

O-Shapes


A block filled with O-shapes.

attr myFrontDepth = 5
attr myRightWidth = 3
attr myBackDepth = 2
attr myLeftWidth = 11

		
LotInner -->
    Lot
        
Lot -->
    offset(-3, inside)
    shapeO(myFrontDepth,myRightWidth,myBackDepth,myLeftWidth) { shape : Footprint | remainder: NIL }

Footprint -->
    extrude(rand(10,20)) color(1,0,0)
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章