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 org.apache.commons.geometry.core.partitioning.AbstractConvexHyperplaneBoundedRegion
AbstractConvexHyperplaneBoundedRegion.ConvexRegionBoundaryBuilder<P extends Point<P>,S extends HyperplaneConvexSubset<P>> -
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 org.apache.commons.geometry.euclidean.threed.ConvexVolume
boundaryStream, fromBounds, fromBounds, full, getCentroid, getSize, split, toTree, transform, trimMethods inherited from class org.apache.commons.geometry.core.partitioning.AbstractConvexHyperplaneBoundedRegion
classify, getBoundaries, getBoundarySize, isEmpty, isFull, project, splitInternal, swapsInsideOutside, toString, transformInternalMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.commons.geometry.euclidean.threed.BoundarySource3D
getBounds, linecast, linecastFirst, toList, toTriangleMesh, triangleStreamMethods inherited from interface org.apache.commons.geometry.euclidean.threed.line.Linecastable3D
linecast, linecastFirstMethods inherited from interface org.apache.commons.geometry.core.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
-