forked from jbdong/CityEngine_cga
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreporting_01.cga
82 lines (52 loc) · 1.31 KB
/
reporting_01.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/**
* File: reporting_01.cga
* Created: 15 Nov 2011 15:44:12 GMT
* Author: andi
*/
version "2012.1"
# ---------------------------------------
# Attributes
# ---------------------------------------
@Group("City Attributes",0)
attr greenspacePercentage = 30
@Group("Building attributes",1)
attr nFloor = ceil(rand(1,15) *buildingHeightFactor)
@Group("Building attributes")
attr floorHeight = rand(4,5)
@Hidden
attr distanceStreet =
20% : 0
else : rand(3,6)
@Hidden
attr distanceBuildings =
50% : 0
else : rand(4,8)
@Group("Mapped",99)
attr buildingHeightFactor = 1
# ---------------------------------------
# Start with the lot
# ---------------------------------------
@StartRule
Lot -->
case p(greenspacePercentage/100):
report("Area.Greenspace",geometry.area)
GreenSpace
else:
report("Area.BuildUp",geometry.area)
BuildingLot
LotInner --> Lot
LotCorner --> Lot
# ---------------------------------------
# Building
# ---------------------------------------
BuildingLot -->
setback(distanceStreet)
{ streetSide: OpenSpace
| remainder: Parcel }
Parcel -->
setback(distanceBuildings/2)
{ noStreetSide: OpenSpace
| remainder: Footprint }
Footprint --> extrude(floorHeight*nFloor) Mass.
GreenSpace --> color("#22aa22") GreenSpace.
OpenSpace --> color("#777777") OpenSpace.