From f2fa64192c3b37e0a4c74c68cf31377f2cea1bdf Mon Sep 17 00:00:00 2001 From: Pablo Vasconez Date: Fri, 10 Nov 2023 16:23:24 +0100 Subject: [PATCH] fix(#19): Fix method `filter_volumes_above_polygons` to consider all the SoilVolumes in plaxis and not only the created volumes, --- src/plxcontroller/plaxis_3d_input_controller.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/plxcontroller/plaxis_3d_input_controller.py b/src/plxcontroller/plaxis_3d_input_controller.py index dce91db..123a12c 100644 --- a/src/plxcontroller/plaxis_3d_input_controller.py +++ b/src/plxcontroller/plaxis_3d_input_controller.py @@ -35,7 +35,7 @@ def g_i(self) -> PlxProxyGlobalObject: @property def plaxis_volumes_bounding_boxes(self) -> Dict[PlxProxyObject, BoundingBox3D]: - """Returns the mapping between the plaxis volumes and their corresponding bounding boxes.""" + """Returns the mapping between the plaxis soil volumes and their corresponding bounding boxes.""" return self._plaxis_volumes_bounding_boxes def filter_volumes_above_polygons( @@ -43,7 +43,7 @@ def filter_volumes_above_polygons( polygons: List[Polygon3D], plaxis_volumes: List[PlxProxyObject] | None = None, ) -> List[PlxProxyObject]: - """Filters the given plaxis volumes if its centroid is located above any polygon + """Filters the given plaxis soil volumes if its centroid is located above any polygon in the given list of polygons. Note that if the centroid of the plaxis volume falls outside the projection @@ -55,7 +55,7 @@ def filter_volumes_above_polygons( the list of polygons. plaxis_volumes : List[PlxProxyObject] | None, optional the list of plaxis volumes to filter from. - If None is given then all the plaxis volumes in the model are used. + If None is given then all the plaxis soil volumes in the model are used. Defaults to None. Returns @@ -68,7 +68,7 @@ def filter_volumes_above_polygons( TypeError if parameters are not of the expected type. ValueError - if any item of plaxis_volumes is not present in the volumes of the plaxis model. + if any item of plaxis_volumes is not present in the soil volumes of the plaxis model. """ # Validate input @@ -92,14 +92,14 @@ def filter_volumes_above_polygons( raise TypeError( f"Unexpected type for item {i} of plaxis_volumes. Expected PlxProxyObject, but got {type(plaxis_volume)}." ) - if plaxis_volume not in self.g_i.Volumes: + if plaxis_volume not in self.g_i.SoilVolumes: raise ValueError( f"Plaxis object {plaxis_volume} is not present in the volumes of the plaxis model." ) # Initialize plaxis_volume list as all the volumes in the Plaxis model. if plaxis_volumes is None: - plaxis_volumes = self.g_i.Volumes + plaxis_volumes = self.g_i.SoilVolumes # Map plaxis volumes to bounding boxes for plaxis_volume in plaxis_volumes: