public final class Plate extends Object implements SolidShape, CrossSectionProvider, Serializable
This is a describing class for a 3D rectangle plate 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 : Plate plate = new plate(center, vectorU, pseudoVectorV, length, width); Intersection with a line : boolean intersects = plate.intersects(line);
Constructor and Description |
---|
Plate(Vector3D inCenter,
Vector3D inU,
Vector3D inV,
double inLength,
double inWidth)
Build a plate from the position of its center and two vectors to describe its local frame and dimensions.
|
Modifier and Type | Method and Description |
---|---|
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 |
getC1() |
Vector3D |
getC2() |
Vector3D |
getC3() |
Vector3D |
getC4() |
Vector3D |
getCenter() |
double |
getCrossSection(Vector3D direction)
Computes the cross section from the direction
defined by a Vector3D.
|
LineSegment[] |
getEdges() |
Vector3D[] |
getIntersectionPoints(Line line)
Compute the intersection points with a line.
|
double |
getLength() |
Vector3D |
getU() |
Vector3D |
getV() |
double |
getWidth() |
boolean |
intersects(Line line)
Tests the intersection with a line.
|
String |
toString()
Get a representation for this plate.
|
public Plate(Vector3D inCenter, Vector3D inU, Vector3D inV, double inLength, double inWidth)
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 rectangle's length along UinWidth
- the rectangle's width along V (once corrected)IllegalArgumentException
- if the vectors do not define a plane, or if the dimensions are negative or nullpublic Vector3D getU()
public Vector3D getV()
public Vector3D getC1()
public Vector3D getC2()
public Vector3D getC3()
public Vector3D getC4()
public double getLength()
public double getWidth()
public Vector3D getCenter()
public boolean intersects(Line line)
intersects
in interface Shape
line
- the linepublic Vector3D[] getIntersectionPoints(Line line)
getIntersectionPoints
in interface Shape
line
- the linepublic double distanceTo(Line line)
distanceTo
in interface Shape
line
- the linepublic Vector3D[] closestPointTo(Line line)
closestPointTo
in interface Shape
line
- the linepublic String toString()
public double getCrossSection(Vector3D direction)
getCrossSection
in interface CrossSectionProvider
direction
- the direction vectorpublic LineSegment[] getEdges()
Copyright © 2023 CNES. All rights reserved.