forked from jbdong/CityEngine_cga
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmassmodeling_02.cga
55 lines (35 loc) · 1 KB
/
massmodeling_02.cga
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/**
* File: massmodeling_02.cga
* Created: 23 May 2008 17:17:42 GMT
* Author: Pascal
*/
version "2011.1"
@Group("Building",2) @Range(20,200)
height =
case geometry.area < 1000: rand(20,50)
else: rand(50,150)
@StartRule
Lot --> Tower
######################
## Towers
######################
@Group("Facade",3) @Range(3,6)
attr floorheight = rand(4,5)
@StartRule
Tower --> extrude(height) Envelope
Envelope -->
case geometry.isRectangular(20):
20% : i("cyl.obj") RecursiveSetbacks
else: RecursiveSetbacks
else: RecursiveSetbacks
lowHeight = 50% : 0.4 else: 0.6 // switching between these two values creates visually appealing setbacks
@Group("Building",2) @Range(0.3,1.2)
attr setbackScale = rand(0.75,0.9) // has to be constant
RecursiveSetbacks -->
case scope.sy > 2*floorheight :
split(y){ 'lowHeight : Mass | ~1: Setback }
else:
s('1,floorheight,'1) Mass
Setback -->
s('setbackScale,'1,'setbackScale) center(xz) RecursiveSetbacks
LotInner --> OpenSpace