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?
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 <SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
https://doc.arcgis.com/en/cityengine/latest/cga/cga-split.htm
https://doc.arcgis.com/en/cityengine/latest/cga/cga-geometry-function.htm#ESRI_SECTION1_7DBA4E7E8618412EAFD572CFA19B17E3
If you want an aligned grid, use the noAdjust option in the split.
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.