-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Hello @htarrido-cuny
In this rule, the reports and the CheckOverlap rule are not working. How can we fix this?
`/**
- File: EventLanes.cga
- Created: 20 Nov 2021 21:04:44 GMT
- Author: mozar
*/
version "2019.0"
import meterConverter: "meterToFeet.cga"
@enum(1,2,3)
attr LOD = 1
const EventDensity = meterConverter.sqmeterTosqft(6) #sqft/person
const textureFolder = "assets/textures/"
@StartRule
you can use offset OR you can use the setback funcion:
BlockDivision-->
setback(3){ all: ExternalRing | remainder: AreaDivider }
report ( "BalanceSpaceArea", geometry.area() )
report ( "PeoplePerEvent", geometry.area()/EventDensity )
ExternalRing-->
setback(3){ all: ExternalRing | remainder: AreaDivider }
color ("#ffcf54")
You can use a combination of split or splitArea to subdive a block or lot to have variation
you can use stochastic percentage assignment, similar to how you would do it in an attribute
to determine outcomes INSIDE the rule
////////////////////////////////////////////////////////////////////////////////////////
// X AXIS LANE DIVIDER /////////////////////////////////////////////////////////////////
AreaDivider -->
split(z){ rand(5,10): WideLanes
| rand(1,2) : Separator
| rand(4,5) : NarrowLanes
| rand(1,2) : Separator
| rand(5,10): WideLanes
| rand(1,2) : Separator }*
Separator-->
color ("#cfcfcf")
NarrowLanes-->
color ("#b3b3b3")
WideLanes -->
case float(listLast(getTreeKey())) % 2 == 0:
split(x){rand(10,20): selectOddLanes }*
else:
Second
////////////////////////////////////////////////////////////////////////////////////////
// TILES IN WIDE LANES /////////////////////////////////////////////////////////////////
selectOddLanes -->
//Seven/////////////////////////////////////
case float(listLast(getTreeKey())) % 7 == 0:
scatter(surface, 2, uniform){ Benches }
Seven
//Five//////////////////////////////////////
case float(listLast(getTreeKey())) % 5 == 0:
Five
Rack
rotate(rel, object, 0, rand(360), 0)
//KIOSKS////////////////////////////////////
//Three/////////////////////////////////////
case float(listLast(getTreeKey())) % 3 == 0:
scatter(surface, 3, uniform){ #primitiveQuad(2,3)
label("kiosk")
/*CheckOverlap*/ }
Three
#Kiosks
//FURNITURE&TREES/////////////////////////////////
//Two////////////////////////////////////////////
case float(listLast(getTreeKey())) % 2 == 0:
#you might want to consider scattering the kios at the larger block and then removving the ones that clash with one another and with other objects.
scatter(surface, 2, uniform){ Benches }
scatter(surface, 2, uniform){ Trees }
Two
//One//////////////////////////////////////
else:
One
////////////////////////////////////////////////////////////////////////////
//KIOSKS///////////////////////////////////////////////////////////////////
Kiosks-->
case LOD == 2 :
rotate(rel, object, 0, rand(360),0)
i("StreetVendor.dae", yUp, keepSizeAlignPosition)
else :
# rotate(rel, object, 0, rand(360),0)
primitiveQuad(meterConverter.feet(6), meterConverter.feet(9))
extrude(meterConverter.feet(6))
color ("#eb4034")
# reduceGeometry(0.5) This makes half of the box. Commenting it.
///////////////////////////////////////////////////////////////////////////////
//RACK/////////////////////////////////////////////////////////////////////////
Rack-->
case LOD == 2 :
#rotate(rel, object, 0, rand(360),0)
i("RackVendorsShelter.dae", yUp, keepSizeAlignPosition)
else :
#rotate(rel, object, 0, rand(360),0)
primitiveQuad(meterConverter.feet(7), meterConverter.feet(16))
extrude(meterConverter.feet(10))
color ("#3cbdcf")
#reduceGeometry(0.5)
///////////////////////////////////////////////////////////////////////////////
//BENCHES//////////////////////////////////////////////////////////////////////
Benches-->
primitiveQuad(rand(5, 7), rand (5,7))
color ("#3d694b")
#LittleBench
#BigBench
LittleBench-->
rotate(rel, object, 0, rand(360),0)
i("Garden+Bench.dae", yUp, keepSizeAlignPosition)
reduceGeometry(0.5)
BigBench-->
rotate(rel, object, 0, rand(360),0)
i("Garden+Bench3.dae", yUp, keepSizeAlignPosition)
reduceGeometry(0.5)
///////////////////////////////////////////////////////////////////////////////
//TREES////////////////////////////////////////////////////////////////////////
Trees-->
case LOD == 2 :
rotate(rel, object, 0, rand(360),0)
i("Tree.dae", yUp, keepSizeAlignPosition)
else:
rotate(rel, object, 0, rand(360),0)
primitiveDisk(16, .5)
extrude(4)
reduceGeometry(0.5)
///////////////////////////////////////////////////////////////////////////////
//TEXTURES/////////////////////////////////////////////////////////////////////
Second-->
color ("#e88079")
Five-->
case LOD == 2 :
tileUV(0,2,2) texture(textureFolder + "ConcreteTiles.jpg")
else : color("#919191")
Three-->
case LOD == 2 :
tileUV(0,2,2) texture(textureFolder + "ConcreteTiles.jpg")
else : color("#919191")
Two-->
case LOD == 2 :
tileUV(0,2,2) texture(textureFolder + "Grass+Concrete.jpg")
else : color("#82a671")
One-->
#color ("#cfcfcf")
split(z){ 0.5 : split(x){ rand(1,3) : Separator | ~7 : Two }
| 0.5 : Separator }*
Seven-->
split(z){ 0.5 : split(x){ rand(1,3) : Two | ~7 : Separator }
| 0.5 : Separator }*
`