Class Parallelepiped
java.lang.Object
org.apache.commons.geometry.core.partitioning.AbstractConvexHyperplaneBoundedRegion<Vector3D, PlaneConvexSubset>
org.apache.commons.geometry.euclidean.threed.ConvexVolume
org.apache.commons.geometry.euclidean.threed.shape.Parallelepiped
- All Implemented Interfaces:
BoundarySource<PlaneConvexSubset>, HyperplaneBoundedRegion<Vector3D>, Splittable<Vector3D, HyperplaneBoundedRegion<Vector3D>>, Region<Vector3D>, Sized, BoundarySource3D, Linecastable3D
Class representing parallelepipeds, i.e. 3 dimensional figures formed by six
parallelograms. For example, cubes and rectangular prisms are parallelepipeds.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classClass designed to aid construction ofParallelepipedinstances.Nested classes/interfaces inherited from class AbstractConvexHyperplaneBoundedRegion
AbstractConvexHyperplaneBoundedRegion.ConvexRegionBoundaryBuilder<P,S> -
Method Summary
Modifier and TypeMethodDescriptionstatic ParallelepipedaxisAligned(Vector3D a, Vector3D b, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision) Return a new instance representing an axis-aligned parallelepiped, ie, a rectangular prism.static Parallelepiped.Builderbuilder(org.apache.commons.numbers.core.Precision.DoubleEquivalence precision) Return a newParallelepiped.Builderinstance to use for constructing parallelepipeds.static ParallelepipedfromTransformedUnitCube(Transform<Vector3D> transform, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision) Construct a new instance by transforming a unit cube centered at the origin.static ParallelepipedunitCube(org.apache.commons.numbers.core.Precision.DoubleEquivalence precision) Construct a new instance representing a unit cube centered at the origin.Methods inherited from class ConvexVolume
boundaryStream, fromBounds, fromBounds, full, getCentroid, getSize, split, toTree, transform, trimMethods inherited from class AbstractConvexHyperplaneBoundedRegion
classify, getBoundaries, getBoundarySize, isEmpty, isFull, project, splitInternal, swapsInsideOutside, toString, transformInternalMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface BoundarySource3D
getBounds, linecast, linecastFirst, toList, toTriangleMesh, triangleStreamMethods inherited from interface Linecastable3D
linecast, linecastFirstMethods inherited from interface Sized
isFinite, isInfinite
-
Method Details
-
unitCube
public static Parallelepiped unitCube(org.apache.commons.numbers.core.Precision.DoubleEquivalence precision) Construct a new instance representing a unit cube centered at the origin. The vertices of this cube are:[ (-0.5, -0.5, -0.5), (0.5, -0.5, -0.5), (0.5, 0.5, -0.5), (-0.5, 0.5, -0.5), (-0.5, -0.5, 0.5), (0.5, -0.5, 0.5), (0.5, 0.5, 0.5), (-0.5, 0.5, 0.5) ]- Parameters:
precision- precision context used to construct boundaries- Returns:
- a new instance representing a unit cube centered at the origin
-
axisAligned
public static Parallelepiped axisAligned(Vector3D a, Vector3D b, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision) Return a new instance representing an axis-aligned parallelepiped, ie, a rectangular prism. The pointsaandbare taken to represent opposite corner points in the prism and may be specified in any order.- Parameters:
a- first corner point in the prism (opposite ofb)b- second corner point in the prism (opposite ofa)precision- precision context used to construct boundaries- Returns:
- a new instance representing an axis-aligned rectangular prism
- Throws:
IllegalArgumentException- if the width, height, or depth of the defined prism is zero as evaluated by the precision context.
-
fromTransformedUnitCube
public static Parallelepiped fromTransformedUnitCube(Transform<Vector3D> transform, org.apache.commons.numbers.core.Precision.DoubleEquivalence precision) Construct a new instance by transforming a unit cube centered at the origin. The vertices of this input cube are:[ (-0.5, -0.5, -0.5), (0.5, -0.5, -0.5), (0.5, 0.5, -0.5), (-0.5, 0.5, -0.5), (-0.5, -0.5, 0.5), (0.5, -0.5, 0.5), (0.5, 0.5, 0.5), (-0.5, 0.5, 0.5) ]- Parameters:
transform- transform to apply to the vertices of the unit cubeprecision- precision context used to construct boundaries- Returns:
- a new instance created by transforming the vertices of a unit cube centered at the origin
- Throws:
IllegalArgumentException- if the width, height, or depth of the defined shape is zero as evaluated by the precision context.
-
builder
public static Parallelepiped.Builder builder(org.apache.commons.numbers.core.Precision.DoubleEquivalence precision) Return a newParallelepiped.Builderinstance to use for constructing parallelepipeds.- Parameters:
precision- precision context used to create boundaries- Returns:
- a new
Parallelepiped.Builderinstance
-