|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.math3.geometry.euclidean.threed.Parallelepiped
public final class Parallelepiped
This is a describing class for a rectangle parallelepiped shape, with some algorithm to compute intersections and distances to some other objects.
Shape.distanceTo(Line)
,
Shape.intersects(Line)
,
Serialized FormCreation with three Vector3D and two doubles : Parallelepiped parallelepiped = new Parallelepiped(center, vectorU, pseudoVectorV, length, width, height); Intersection with a line : boolean intersects = parallelepiped(line);
Constructor Summary | |
---|---|
Parallelepiped(Vector3D inCenter,
Vector3D inU,
Vector3D inV,
double inLength,
double inWidth,
double inHeight)
Build a parallelepiped from the position of its center, two vectors to describe its local frame and dimensions. |
Method Summary | |
---|---|
Vector3D[] |
closestPointTo(Line line)
Computes the points of the shape and the line realizing the shortest distance. |
double |
distanceTo(Line line)
Computes the distance to a line. |
Vector3D |
getCenter()
|
Vector3D[] |
getCorners()
|
double |
getCrossSection(Vector3D direction)
Computes the cross section from the direction defined by a Vector3D. |
Plate[] |
getFaces()
|
double |
getHeight()
|
Vector3D[] |
getIntersectionPoints(Line line)
Compute the intersection points with a line. |
double |
getLength()
|
Vector3D |
getU()
|
Vector3D |
getV()
|
Vector3D |
getW()
|
double |
getWidth()
|
boolean |
intersects(Line line)
Tests the intersection with a line. |
String |
toString()
Get a representation for this parallelepiped. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Parallelepiped(Vector3D inCenter, Vector3D inU, Vector3D inV, double inLength, double inWidth, double inHeight)
inCenter
- the center of the plateinU
- a non-normalised vector parallel to uinV
- the second vector defining the plate's plane : corrected to be orthogonal to UinLength
- the parallelepiped's length along UinWidth
- the parallelepiped's width along V (once corrected)inHeight
- the parallelepiped's height
IllegalArgumentException
- if the vectors do not define a plane, or if the dimensions are negative or nullMethod Detail |
---|
public Vector3D getCenter()
public Vector3D getU()
public Vector3D getV()
public Vector3D getW()
public double getLength()
public double getWidth()
public double getHeight()
public Vector3D[] getCorners()
public Plate[] getFaces()
public boolean intersects(Line line)
intersects
in interface Shape
line
- the line
public Vector3D[] getIntersectionPoints(Line line)
getIntersectionPoints
in interface Shape
line
- the line
public double distanceTo(Line line)
distanceTo
in interface Shape
line
- the line
public Vector3D[] closestPointTo(Line line)
closestPointTo
in interface Shape
line
- the line
public String toString()
toString
in class Object
public double getCrossSection(Vector3D direction)
getCrossSection
in interface CrossSectionProvider
direction
- the direction vector
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |