Hello, I want to put a lot of buildings in a large parcel area. However, there should be some distances between the buildings and no buildings overflowing outside the parcel area.(Like in the attached png.)
How do I create a rule, I'm new to writing rules. Can you help me with the method?
Solved! Go to Solution.
You can split your parcel shape into a grid of building footprints and use geometry.isRectangular to discard the ones that are not rectangular.
Parcel -->
split(x) { { ~spacing: NIL
| width: ParcelSlice }*
| ~spacing: NIL }
ParcelSlice -->
split(z) { { ~spacing: NIL
| width: TestFootprint }*
| ~spacing: NIL }
TestFootprint -->
case geometry.isRectangular(0.1):
Footprint.
else:
NIL
https://doc.arcgis.com/en/cityengine/latest/cga/cga-split.htm
If you want an aligned grid, use the noAdjust option in the split.
You can split your parcel shape into a grid of building footprints and use geometry.isRectangular to discard the ones that are not rectangular.
Parcel -->
split(x) { { ~spacing: NIL
| width: ParcelSlice }*
| ~spacing: NIL }
ParcelSlice -->
split(z) { { ~spacing: NIL
| width: TestFootprint }*
| ~spacing: NIL }
TestFootprint -->
case geometry.isRectangular(0.1):
Footprint.
else:
NIL
https://doc.arcgis.com/en/cityengine/latest/cga/cga-split.htm
If you want an aligned grid, use the noAdjust option in the split.