From b437cdf290bca82a4730578d7dd73dfb22c0e494 Mon Sep 17 00:00:00 2001 From: Pilar Date: Thu, 23 Feb 2023 06:57:14 -0500 Subject: [PATCH] partially implemented shared walls --- hub/city_model_structure/attributes/plane.py | 2 +- hub/city_model_structure/building.py | 1 - hub/city_model_structure/building_demand/surface.py | 9 +++++++++ hub/city_model_structure/city_object.py | 1 + hub/imports/geometry/rhino.py | 2 +- 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/hub/city_model_structure/attributes/plane.py b/hub/city_model_structure/attributes/plane.py index 700be8fb..8dc0fa77 100644 --- a/hub/city_model_structure/attributes/plane.py +++ b/hub/city_model_structure/attributes/plane.py @@ -55,7 +55,7 @@ class Plane: self._equation = (a, b, c, d) return self._equation - def distance(self, point): + def distance_to_point(self, point): """ Distance between the given point and the plane :return: float diff --git a/hub/city_model_structure/building.py b/hub/city_model_structure/building.py index 8da9df71..65c3e417 100644 --- a/hub/city_model_structure/building.py +++ b/hub/city_model_structure/building.py @@ -44,7 +44,6 @@ class Building(CityObject): self._appliances_electrical_demand = dict() self._domestic_hot_water_heat_demand = dict() self._eave_height = None - self._neighbours = None self._grounds = [] self._roofs = [] self._walls = [] diff --git a/hub/city_model_structure/building_demand/surface.py b/hub/city_model_structure/building_demand/surface.py index 285393e3..3a64bf2a 100644 --- a/hub/city_model_structure/building_demand/surface.py +++ b/hub/city_model_structure/building_demand/surface.py @@ -336,3 +336,12 @@ class Surface: :param value: None or [ThermalBoundary] """ self._associated_thermal_boundaries = value + + def shared_percentage(self, neighbour_surface): + """ + Calculate the percentage of a surface that is shared with a neighbour surface + :return: float + """ + _shared_percentage = 0 + + return _shared_percentage \ No newline at end of file diff --git a/hub/city_model_structure/city_object.py b/hub/city_model_structure/city_object.py index 70594bbc..52dffd52 100644 --- a/hub/city_model_structure/city_object.py +++ b/hub/city_model_structure/city_object.py @@ -33,6 +33,7 @@ class CityObject: self._diffuse = dict() self._beam = dict() self._sensors = [] + self._neighbours = None @property def name(self): diff --git a/hub/imports/geometry/rhino.py b/hub/imports/geometry/rhino.py index dab5cd2e..c4bf354d 100644 --- a/hub/imports/geometry/rhino.py +++ b/hub/imports/geometry/rhino.py @@ -124,7 +124,7 @@ class Rhino: # todo: this is a hack for dompark project it should not be done this way windows should be correctly modeled # if the distance between the wall plane and the window is less than 2m # and the window Z coordinate it's between the wall Z, it's a window of that wall - if plane.distance(corner) <= 2: + if plane.distance_to_point(corner) <= 2: # check if the window is in the right high. if surface.upper_corner[2] >= corner[2] >= surface.lower_corner[2]: if surface.holes_polygons is None: