RegionBounds

RegionBounds[reg]

gives the bounds for the region reg.

RegionBounds[reg,"type"]

gives region bounds of the specified "type".

Details and Options

  • RegionBounds is also known as bounding box and bounding volume.
  • RegionBounds returns a list {{xmin,xmax},{ymin,ymax},} of length equal to RegionEmbeddingDimension[reg].
  • For an unbounded region, one or several of the coordinate ranges can contain Infinity.
  • The following region range "type" specifications can be given:
  • "Minimal"minimal bounds (default)
    "Sufficient"sufficient bounds
    "Finite"finite range of interest, not necessarily bounding

Examples

open allclose all

Basic Examples  (3)

Find bounds for a region in :

Visualize the bounds:

Find bounds for a region in :

Visualize the bounds:

Unbounded regions have infinite bounds:

Scope  (23)

Basic Uses  (3)

By default, the "Minimal" bounding region is returned:

Visualize bounds:

Use "Finite" to get some finite bounding region even if the region is not bounded:

Visualize bounds:

Other range types return infinite ranges:

"Finite" may not necessarily return the smallest bounding region:

Special Regions  (7)

Regions in :

Regions in :

Visualize a region range in :

Regions in :

Visualize a region range in :

Regions in :

Specify the "Finite" type to get finite bounds for unbounded regions:

Formula Regions  (3)

A union of two disks as an ImplicitRegion:

Visualize bounds:

A union of two cylinders as an ImplicitRegion:

Visualize bounds:

A rational parametrization of a disk represented as a ParametricRegion:

Visualize bounds:

Mesh Regions  (4)

MeshRegion in 2D:

Visualize bounds:

MeshRegion in 3D:

Visualize bounds:

BoundaryMeshRegion in 2D:

Visualize bounds:

BoundaryMeshRegion in 3D:

Visualize bounds:

Derived Regions  (4)

RegionIntersection of two regions:

Visualize bounds:

RegionUnion of mixed-dimensional regions:

Visualize bounds:

TransformedRegion:

Visualize bounds:

RegionBoundary:

Geographic Regions  (2)

Polygons with GeoPosition:

Visualize bounds:

The boundary of a polygon with GeoGridPosition:

Visualize bounds:

Applications  (5)

Find a bounding Sphere to a region's bounding box:

Compute corner points of bounding box:

Compute bounding sphere:

Visualize bounding surfaces:

Find a bounding Ellipsoid to a region's bounding box:

Compute the bounding box:

Compute a bounding ellipsoid to the bounding box:

Visualize bounding surfaces:

Check for possible region inclusion by checking if bounding boxes overlap:

Compute bounds for each region:

For each dimension, check if bounds intersect:

Bounding boxes overlap if and only if bounds in every dimension overlap:

Create a fast membership rejection test:

Create a region member function:

Create a member function for the region's bounding box:

Generate points for testing:

Use region member function to select member points after filtering with bounding box member function:

Compare the timing of only using the region member function:

Both approaches return the same member points:

Fit an oriented bounding box of least area to a region:

Find the transform for each edge of the region's convex hull that aligns it with the axis:

Compute oriented bounding boxes aligned with each edge of the convex hull:

Find the transform that will orient the bounding box with the smallest area to the region:

Visualize the oriented bounding box and region:

Properties & Relations  (7)

The range is finite for bounded regions:

The range is infinite for unbounded regions:

RegionBounds may be used as input to DiscretizeRegion:

Double the default DiscretizeRegion bounding range:

RegionBounds may be used as input to VoronoiMesh:

VoronoiMesh at varying bounding ranges:

RegionBounds may be used to specify a PlotRange to DiscretizeGraphics:

VoronoiMesh at varying bounding ranges:

Transpose a 2D region's bounds to get coordinates for Rectangle:

Transpose a 3D region's bounds to get coordinates for Cuboid:

Region bounds may be passed directly into UniformDistribution:

Get the region bounds:

Uniformly sample over the bounded region:

Wolfram Research (2014), RegionBounds, Wolfram Language function, https://reference.wolfram.com/language/ref/RegionBounds.html.

Text

Wolfram Research (2014), RegionBounds, Wolfram Language function, https://reference.wolfram.com/language/ref/RegionBounds.html.

CMS

Wolfram Language. 2014. "RegionBounds." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/RegionBounds.html.

APA

Wolfram Language. (2014). RegionBounds. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RegionBounds.html

BibTeX

@misc{reference.wolfram_2024_regionbounds, author="Wolfram Research", title="{RegionBounds}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/RegionBounds.html}", note=[Accessed: 22-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_regionbounds, organization={Wolfram Research}, title={RegionBounds}, year={2014}, url={https://reference.wolfram.com/language/ref/RegionBounds.html}, note=[Accessed: 22-November-2024 ]}