public final class Bounds3D extends AbstractBounds<Vector3D,Bounds3D>
Instances of this class are guaranteed to be immutable.
Modifier and Type | Class and Description |
---|---|
static class |
Bounds3D.Builder
Class used to construct
Bounds3D instances. |
Modifier and Type | Method and Description |
---|---|
static Bounds3D.Builder |
builder()
Construct a new
Bounds3D.Builder instance for creating bounds. |
boolean |
contains(Vector3D pt)
Return true if the given point is strictly within or on the boundary of the bounding box.
|
boolean |
contains(Vector3D pt,
Precision.DoubleEquivalence precision)
Return true if the given point is within or on the boundary of the bounding box, using the given
precision context for floating point comparisons.
|
boolean |
equals(Object obj) |
static Bounds3D |
from(Iterable<Vector3D> points)
Construct a new instance from the given points.
|
static Bounds3D |
from(Vector3D first,
Vector3D... more)
Construct a new instance from the given points.
|
int |
hashCode() |
boolean |
hasSize(Precision.DoubleEquivalence precision)
Return true if the bounding box has non-zero size along each coordinate axis, as
evaluated by the given precision context.
|
Bounds3D |
intersection(Bounds3D other)
Return the intersection of this bounding box and the argument, or null if no intersection exists.
|
boolean |
intersects(Bounds3D other)
Return true if any point on the interior or boundary of this instance is also considered to be
on the interior or boundary of the argument.
|
Parallelepiped |
toRegion(Precision.DoubleEquivalence precision)
Return a hyperplane-bounded region containing the same points as this instance.
|
eq, getCentroid, getDiagonal, getMax, getMin, toString
public boolean hasSize(Precision.DoubleEquivalence precision)
hasSize
in class AbstractBounds<Vector3D,Bounds3D>
precision
- precision context used for floating point comparisonspublic boolean contains(Vector3D pt)
pt >= mint
and
pt <= maxt
for each coordinate value t
.
Floating point comparisons are strict; values are considered equal only if they match exactly.contains
in class AbstractBounds<Vector3D,Bounds3D>
pt
- the point to checkAbstractBounds.contains(EuclideanVector, Precision.DoubleEquivalence)
public boolean contains(Vector3D pt, Precision.DoubleEquivalence precision)
AbstractBounds.contains(EuclideanVector)
but allows points that may be strictly outside of the box due to floating point errors to be considered
inside.contains
in class AbstractBounds<Vector3D,Bounds3D>
pt
- the point to checkprecision
- precision context used to compare floating point valuesAbstractBounds.contains(EuclideanVector, Precision.DoubleEquivalence)
public boolean intersects(Bounds3D other)
aMint <= bMaxt
and aMaxt >= bMint
for all coordinate values t
, where a
is the current instance and b
is the argument.
Floating point comparisons are strict; values are considered equal only if they match exactly.intersects
in class AbstractBounds<Vector3D,Bounds3D>
other
- bounding box to intersect withpublic Bounds3D intersection(Bounds3D other)
intersection
in class AbstractBounds<Vector3D,Bounds3D>
other
- bounding box to intersect withAbstractBounds.intersects(AbstractBounds)
public Parallelepiped toRegion(Precision.DoubleEquivalence precision)
toRegion
in class AbstractBounds<Vector3D,Bounds3D>
precision
- precision context used for floating point comparisons in the returned
region instanceIllegalArgumentException
- if any dimension of the bounding box is zero
as evaluated by the given precision contextpublic static Bounds3D from(Vector3D first, Vector3D... more)
first
- first pointmore
- additional pointspublic static Bounds3D from(Iterable<Vector3D> points)
points
- input pointspublic static Bounds3D.Builder builder()
Bounds3D.Builder
instance for creating bounds.Copyright © 2016–2021 The Apache Software Foundation. All rights reserved.