porepy.geometry.bounding_box module
Compute bounding boxes of geometric objects.
- from_grid(g)[source]
Return the bounding box of the grid.
- Parameters
g (Grid) – The grid for which the bounding box is to be computed.
- Returns
A 2-tuple containing
ndrarray
:shape=(3,)
Minimum node coordinates in each direction.
ndrarray
:shape=(3,)
Maximum node coordinates in each direction.
- Return type
- 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
Union[dict[str, float], tuple[numpy.ndarray, numpy.ndarray]]
- 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
- make_bounding_planes_from_box(box)[source]
Translate the bounding box into fractures. Tag them as boundaries.
For now the domain specification is limited to a box consisting of six planes.