porepy.geometry.bounding_box module
Compute bounding boxes of geometric objects.
- class DomainSides(all_bf, east, west, north, south, top, bottom)[source]
Bases:
NamedTuple
Type for domain sides.
- Parameters:
all_bf (npt.NDArray[np.int_])
east (npt.NDArray[np.bool_])
west (npt.NDArray[np.bool_])
north (npt.NDArray[np.bool_])
south (npt.NDArray[np.bool_])
top (npt.NDArray[np.bool_])
bottom (npt.NDArray[np.bool_])
- from_md_grid(mdg, as_dict=False)[source]
Return the bounding box of a mixed-dimensional grid.
- Parameters:
mdg (MixedDimensionalGrid) – Mixed-dimensional grid for which the bounding box is to be computed.
as_dict (bool) –
default=False
If
True
, the bounding box is returned as a dictionary, ifFalse
, it is represented by arrays with max and min values.
- Returns:
If
as_dict
isTrue
, the bounding box is represented as a dictionary with keysxmin
,xmax
,ymin
,ymax
,zmin
, andzmax
.Else, two
ndarrays
are returned, containing the min and max values of the coordinates, respectively.- Return type:
- from_points(pts, overlap=0)[source]
Obtain a bounding box for a point cloud.
- Parameters:
- Returns:
The domain represented as a dictionary with keywords
xmin
,xmax
,ymin
,ymax
, and (ifnd == 3
)zmin
andzmax
.- Return type: