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. This post is about the second issue - corner depth of imported parcels. Here is a link to the first and a link to the third one.
There is an automatic attribute for the corner width (not depth) for dynamic shapes created from graph network. But in urban design we already have parcels and need to specify the build up area for them. There are cases in which a corner parcel has no setbacks from the streets and an offset / chamfer from the corner must be set along the bisector of the angle. That offset must have a distance of 2 meters from the corner. You can see the attached sketch for more clarity.
I need to be able to set this corner offset and then to extrude the 3D Volume. I set the setbacks in BuildArea rule and I found a way to distinguish the corner lots from the others - Lot rule. In the BuildArea rule I also try to select somehow the corner and then give it a distance but as far as I get is a rectangular shape and not something that I can use. Furthermore, this distance is not along the bisector but along the x and z axes. Would any mix of split, comp and offset operation do the trick?
Here is the CGA code and I attach a screenshot of my work.
@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
@Group<SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Volume"</SPAN><SPAN class="punctuation token">)</SPAN>
attr streetWidth<SPAN class="punctuation token">(</SPAN>i<SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">=</SPAN> <SPAN class="number token">0</SPAN>
@StartRule
<SPAN class="comment token"># SETBACKS </SPAN>
BuildArea <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> Lot <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> Lot <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> Lot <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> Lot <SPAN class="operator token">|</SPAN> remainder<SPAN class="punctuation token">:</SPAN>
split<SPAN class="punctuation token">(</SPAN>x<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">{</SPAN>scope<SPAN class="punctuation token">.</SPAN>sx<SPAN class="number token">-1</SPAN><SPAN class="punctuation token">:</SPAN>BuildVolume <SPAN class="operator token">|</SPAN> <SPAN class="number token">99</SPAN><SPAN class="punctuation token">:</SPAN>split<SPAN class="punctuation token">(</SPAN>z<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">{</SPAN>scope<SPAN class="punctuation token">.</SPAN>sz<SPAN class="number token">-1</SPAN><SPAN class="punctuation token">:</SPAN>BuildVolume<SPAN class="operator token">|</SPAN><SPAN class="number token">99</SPAN><SPAN class="punctuation token">:</SPAN>Lot<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="punctuation token">}</SPAN>
<SPAN class="comment token"># CORNER LOTS </SPAN>
Lot <SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN>
CornerRecursion<SPAN class="punctuation token">(</SPAN>geometry<SPAN class="punctuation token">.</SPAN>nVertices <SPAN class="operator token">-</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">0</SPAN><SPAN class="punctuation token">)</SPAN>
CornerRecursion <SPAN class="punctuation token">(</SPAN> edgeID<SPAN class="punctuation token">,</SPAN> nStreetEdges <SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">-</SPAN><SPAN class="operator token">-</SPAN><SPAN class="operator token">></SPAN>
case edgeID <SPAN class="operator token">>=</SPAN> <SPAN class="number token">0</SPAN> <SPAN class="punctuation token">:</SPAN>
case streetWidth<SPAN class="punctuation token">(</SPAN>edgeID<SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">></SPAN> <SPAN class="number token">0</SPAN> <SPAN class="punctuation token">:</SPAN>
CornerRecursion <SPAN class="punctuation token">(</SPAN> edgeID <SPAN class="operator token">-</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN> nStreetEdges <SPAN class="operator token">+</SPAN> <SPAN class="number token">1</SPAN> <SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">else</SPAN><SPAN class="punctuation token">:</SPAN>
CornerRecursion <SPAN class="punctuation token">(</SPAN> edgeID <SPAN class="operator token">-</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN> nStreetEdges <SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">else</SPAN><SPAN class="punctuation token">:</SPAN>
case nStreetEdges <SPAN class="operator token">>=</SPAN> <SPAN class="number token">2</SPAN> <SPAN class="punctuation token">:</SPAN>
IsCornerLot
<SPAN class="keyword token">else</SPAN><SPAN class="punctuation token">:</SPAN>
IsNotCornerLot
IsCornerLot <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">#ff0000") </SPAN>
IsNotCornerLot <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">#0000ff") </SPAN>
<SPAN class="comment token"># EXTRUSION</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></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>