# Setbacks based on neighboring building's height

783
3
05-09-2018 03:07 AM
New Contributor II

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("Setbacks")@Order(1)
attr Front_setback = 5
@Group("Setbacks")@Order(2)
attr Back_setback = 5
@Group("Setbacks")@Order(3)
attr Left_setback = 5
@Group("Setbacks")@Order(4)
attr Right_setback = 5

@Group("Visual")@Order(1)
attr Function = "#ff0000"
@Group("Visual")@Order(2)
attr Opacity = 0.7

@Group("Volume")@Order(1)
attr Eave_height = 0
@Group("Volume")@Order(2)
attr Max_height = 0
@Group("Volume")@Order(3)
attr Roof_angle =
case Max_height == Eave_height : 0
else: 45
@Group("Volume")
attr height = Max_height

@StartRule
Parcel -->
setback(Front_setback) { street.front: Garden | remainder:
setback(Back_setback) { street.back: Garden | remainder:
setback(Left_setback) { street.left: Garden | remainder:
setback(Right_setback) { street.right: Garden | remainder:
label("label")
Tester
}
}
}
}

Tester -->
case minimumDistance(intra,"label") < 1 : offset(-1)BuildVolume # тук проверяваме за разстояния между обекти с label "label", които са всички за момента и им задаваме BuildVolume. Самият BuildVolume трябва да има предвид височината си според височината на другата сграда.
else : primitiveCylinder(16, 0.05, 0.5)

Garden --> color("#27ae60")

BuildVolume -->
envelope(world.up, Max_height, Eave_height, Roof_angle, Eave_height, Roof_angle, Eave_height, Roof_angle, Eave_height, Roof_angle)
set(material.opacity, Opacity)‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍``````
Tags (4)
3 Replies
Esri Regular Contributor

Try using inter instead of intra in minimumDistance().  Intra means only the shapes in the current shape tree are tested.  Inter means that only the shapes that are not part of the current shape are tested.

This works for me.  Changing the frontSetback changes the height of the building.

``````attr frontSetback = 5

Parcel -->
setback(frontSetback) { front: Garden | remainder: Lot }

Garden -->
color(0,1,0)

Lot -->
label("Lot")
Mass

Mass -->
print(minimumDistance(inter, "Lot"))
extrude(minimumDistance(inter, "Lot"))
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍``````

New Contributor II

Thank you for the replyCheryl Lau.

I tried with "inter" in minimumDistance(). It works to find distances to neighboring buildings as you can see from the Tester rule.

But the rule affects every building. I need to compare the buildings and then affect the height only of the southern building as it is the one that drops shadow. I am thinking of some new selector in the minimumDistance() for example "world.north" so the height of the building could be set by the value of the distance only to the northern building. Is something like that possible ?

As part of Esri Bulgaria, I am preparing rules which would help automate the zonning process when creating plans and the planning cliens are asking us for this kind of functionalities.

Also, the changed height of the buildings is seen only in the 3d View window, but the values do not change in the Inspector. I found that this is more fundamental issue but something that is going to improve the overall representation of data, especially in the urban planning sphere, where exact values are needed to be known and shown.

``````@Group("Setbacks")@Order(1)
attr Front_setback = 5
@Group("Setbacks")@Order(2)
attr Back_setback = 5
@Group("Setbacks")@Order(3)
attr Left_setback = 5
@Group("Setbacks")@Order(4)
attr Right_setback = 5

@Group("Visual")@Order(1)
attr Function = "#ff0000"
@Group("Visual")@Order(2)
attr Opacity = 0.7

@Group("Volume")@Order(1)
attr Eave_height = 0
@Group("Volume")@Order(2)
attr Max_height = 0
@Group("Volume")@Order(3)
attr Roof_angle =
case Max_height == Eave_height : 0
else: 45
@Group("Volume")
attr height = Max_height

@StartRule
Parcel -->
setback(Front_setback) { street.front: Garden | remainder:
setback(Back_setback) { street.back: Garden | remainder:
setback(Left_setback) { street.left: Garden | remainder:
setback(Right_setback) { street.right: Garden | remainder:
BuildArea
}
}
}
}

Garden --> color("#27ae60")

BuildArea -->
label("checkDistance")
Tester

Tester -->
case minimumDistance(inter,"checkDistance") >= Eave_height : BuildVolume
else : NewBuild

BuildVolume -->
envelope(world.up, Max_height, Max_height, Roof_angle)
set(material.opacity, Opacity)

NewBuild -->
envelope(world.up, minimumDistance(inter,"checkDistance"), minimumDistance(inter,"checkDistance"), Roof_angle)
color("#000000")‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍``````
Esri Regular Contributor

You can control what is compared in minimumDistance by choosing the appropriate label.  But, then you have to set the label appropriately for all the shapes, and I'm not sure how you could do so in order to get what you want.

The inspector shows the values that are initially set by the rule or the values that are set by the user (bold) or the values set by linking (source appears in parentheses).  The inspector does not show values of attributes that are reset within the rule using the set() operation.  This is because the set() operation only applies to that node which calls it and it's subtree.  Other shapes in the subtree might have a different value for the same attribute.

You can use reports to display the height in the Inspector (in the Reports section).  You can also use the dashboard to visualize the desired reported value nicely.