I am currently working on 3D zoning and I face 3 issues for which I looked all over the forum, the help documentation and the tutorials and I can't figure out how to solve them. Here is a link to the first and a link to the second one. This issue is about setting the setbacks of a building according to the height of the buildings around it.
The setback regulations in Bulgaria for residential buildings above 10m is considering the height of the buildings because of the created shades. An example you can see in the attached file. We have two buildings - S(southern) and N(northern). The max height of S must be no greater than the distance between the two buildings, which includes the north setback of S and the south setback of N. This way even the ground floor of N is guaranteed to have access to sunlight.
As a workflow for turning this regulation in CGA rules I marked the following steps:
- a parcel shape needs to know which are its neighbors -
- then to check weather they are south, north of it and to select them accordingly
- then get the data from the attributes for height
- and calculate and divide the height of the neighbor to the setbacks of the current shape and the neighbor shape
I didn't find a way to catch the distance between scopes which is kind of blocking the further steps. I tried using the minimumDistance as you can see from the cga code but without success.
Is there a way this regulation to be recreated through CGA rules?
@Group<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Setbacks"</SPAN><SPAN class="punctuation token">)</SPAN>@Order<SPAN class="punctuation token">(</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">)</SPAN>
attr Front_setback <SPAN class="operator token">=</SPAN> <SPAN class="number token">5</SPAN>
@Group<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Setbacks"</SPAN><SPAN class="punctuation token">)</SPAN>@Order<SPAN class="punctuation token">(</SPAN><SPAN class="number token">2</SPAN><SPAN class="punctuation token">)</SPAN>
attr Back_setback <SPAN class="operator token">=</SPAN> <SPAN class="number token">5</SPAN>
@Group<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Setbacks"</SPAN><SPAN class="punctuation token">)</SPAN>@Order<SPAN class="punctuation token">(</SPAN><SPAN class="number token">3</SPAN><SPAN class="punctuation token">)</SPAN>
attr Left_setback <SPAN class="operator token">=</SPAN> <SPAN class="number token">5</SPAN>
@Group<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Setbacks"</SPAN><SPAN class="punctuation token">)</SPAN>@Order<SPAN class="punctuation token">(</SPAN><SPAN class="number token">4</SPAN><SPAN class="punctuation token">)</SPAN>
attr Right_setback <SPAN class="operator token">=</SPAN> <SPAN class="number token">5</SPAN>
@Group<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Visual"</SPAN><SPAN class="punctuation token">)</SPAN>@Order<SPAN class="punctuation token">(</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">)</SPAN>
attr Function <SPAN class="operator token">=</SPAN> "<SPAN class="comment token">#ff0000"</SPAN>
@Group<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Visual"</SPAN><SPAN class="punctuation token">)</SPAN>@Order<SPAN class="punctuation token">(</SPAN><SPAN class="number token">2</SPAN><SPAN class="punctuation token">)</SPAN>
attr Opacity <SPAN class="operator token">=</SPAN> <SPAN class="number token">0.7</SPAN>
@Group<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Volume"</SPAN><SPAN class="punctuation token">)</SPAN>@Order<SPAN class="punctuation token">(</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">)</SPAN>
attr Eave_height <SPAN class="operator token">=</SPAN> <SPAN class="number token">0</SPAN>
@Group<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Volume"</SPAN><SPAN class="punctuation token">)</SPAN>@Order<SPAN class="punctuation token">(</SPAN><SPAN class="number token">2</SPAN><SPAN class="punctuation token">)</SPAN>
attr Max_height <SPAN class="operator token">=</SPAN> <SPAN class="number token">0</SPAN>
@Group<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Volume"</SPAN><SPAN class="punctuation token">)</SPAN>@Order<SPAN class="punctuation token">(</SPAN><SPAN class="number token">3</SPAN><SPAN class="punctuation token">)</SPAN>
attr Roof_angle <SPAN class="operator token">=</SPAN>
case Max_height <SPAN class="operator token">==</SPAN> Eave_height <SPAN class="punctuation token">:</SPAN> <SPAN class="number token">0</SPAN>
<SPAN class="keyword token">else</SPAN><SPAN class="punctuation token">:</SPAN> <SPAN class="number token">45</SPAN>
@Group<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Volume"</SPAN><SPAN class="punctuation token">)</SPAN>
attr height <SPAN class="operator token">=</SPAN> Max_height
@StartRule
Parcel <SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN>
setback<SPAN class="punctuation token">(</SPAN>Front_setback<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> street<SPAN class="punctuation token">.</SPAN>front<SPAN class="punctuation token">:</SPAN> Garden <SPAN class="operator token">|</SPAN> remainder<SPAN class="punctuation token">:</SPAN>
setback<SPAN class="punctuation token">(</SPAN>Back_setback<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> street<SPAN class="punctuation token">.</SPAN>back<SPAN class="punctuation token">:</SPAN> Garden <SPAN class="operator token">|</SPAN> remainder<SPAN class="punctuation token">:</SPAN>
setback<SPAN class="punctuation token">(</SPAN>Left_setback<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> street<SPAN class="punctuation token">.</SPAN>left<SPAN class="punctuation token">:</SPAN> Garden <SPAN class="operator token">|</SPAN> remainder<SPAN class="punctuation token">:</SPAN>
setback<SPAN class="punctuation token">(</SPAN>Right_setback<SPAN class="punctuation token">)</SPAN> <SPAN class="punctuation token">{</SPAN> street<SPAN class="punctuation token">.</SPAN>right<SPAN class="punctuation token">:</SPAN> Garden <SPAN class="operator token">|</SPAN> remainder<SPAN class="punctuation token">:</SPAN>
label<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"label"</SPAN><SPAN class="punctuation token">)</SPAN>
Tester
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN>
Tester <SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN>
case minimumDistance<SPAN class="punctuation token">(</SPAN>intra<SPAN class="punctuation token">,</SPAN><SPAN class="string token">"label"</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token"><</SPAN> <SPAN class="number token">1</SPAN> <SPAN class="punctuation token">:</SPAN> offset<SPAN class="punctuation token">(</SPAN><SPAN class="operator token">-</SPAN><SPAN class="number token">1</SPAN><SPAN class="punctuation token">)</SPAN>BuildVolume <SPAN class="comment token"># тук проверяваме за разстояния между обекти с label "label", които са всички за момента и им задаваме BuildVolume. Самият BuildVolume трябва да има предвид височината си според височината на другата сграда.</SPAN>
<SPAN class="keyword token">else</SPAN> <SPAN class="punctuation token">:</SPAN> primitiveCylinder<SPAN class="punctuation token">(</SPAN><SPAN class="number token">16</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">0.05</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">0.5</SPAN><SPAN class="punctuation token">)</SPAN>
Garden <SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN> color<SPAN class="punctuation token">(</SPAN>"<SPAN class="comment token">#27ae60")</SPAN>
BuildVolume <SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN>
envelope<SPAN class="punctuation token">(</SPAN>world<SPAN class="punctuation token">.</SPAN>up<SPAN class="punctuation token">,</SPAN> Max_height<SPAN class="punctuation token">,</SPAN> Eave_height<SPAN class="punctuation token">,</SPAN> Roof_angle<SPAN class="punctuation token">,</SPAN> Eave_height<SPAN class="punctuation token">,</SPAN> Roof_angle<SPAN class="punctuation token">,</SPAN> Eave_height<SPAN class="punctuation token">,</SPAN> Roof_angle<SPAN class="punctuation token">,</SPAN> Eave_height<SPAN class="punctuation token">,</SPAN> Roof_angle<SPAN class="punctuation token">)</SPAN>
set<SPAN class="punctuation token">(</SPAN>material<SPAN class="punctuation token">.</SPAN>opacity<SPAN class="punctuation token">,</SPAN> Opacity<SPAN class="punctuation token">)</SPAN><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></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><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></SPAN></SPAN>