Skip to content

Commit

Permalink
fix(#19): Fix method filter_volumes_above_polygons to consider all …
Browse files Browse the repository at this point in the history
…the SoilVolumes in plaxis and not only the created volumes,
  • Loading branch information
Pablo Vasconez committed Nov 10, 2023
1 parent 0024445 commit f2fa641
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/plxcontroller/plaxis_3d_input_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ 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(
self,
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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand Down

0 comments on commit f2fa641

Please sign in to comment.