public final class InfiniteRectangleCylinder extends Object implements InfiniteCylinder
This is a describing class for a 3D infinite rectangle cylinder, with some algorithm to compute intersections and distances to some other objects.
Shape.distanceTo(Line),
Shape.intersects(Line)Creation with its dimensions and three Vector3D : Vector3D origin = new Vector3D(1.0, 6.0, -2.0); Vector3D direction = new Vector3D(6.0, -3.0, -1.0); Vector3D uVector = new Vector3D(-5.0, 3.0, 0.0); double length = 2.0; double width = 3.0; InfiniteRectangleCylinder cylinder = new InfiniteRectangleCylinder(origin, direction, uVector, length, width); Creation with a line, a Vector3D (u vector) and the dimensions : InfiniteRectangleCylinder cylinder = new InfiniteRectangleCylinder(line, uVector, length, width); Intersection with a line : boolean intersects = cylinder(line);
| Constructor and Description |
|---|
InfiniteRectangleCylinder(Line inDirection,
Vector3D inUVector,
double inLength,
double inWidth)
Build an infinite rectangle cylinder from its dimensions, orientation and the origin and direction of its axis
|
InfiniteRectangleCylinder(Vector3D inOrigin,
Vector3D inDirection,
Vector3D inUvector,
double inLength,
double inWidth)
Build an infinite rectangle cylinder from its dimensions, orientation and the origin and direction of its axis
|
| 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 |
getDirection() |
Vector3D[] |
getIntersectionPoints(Line line)
Compute the intersection points with a line.
|
double |
getLength() |
Vector3D |
getOrigin() |
Vector3D |
getU() |
Vector3D |
getV() |
double |
getWidth() |
boolean |
intersects(Line line)
Tests the intersection with a line.
|
String |
toString()
Get a representation for this infinite rectangle cylinder.
|
public InfiniteRectangleCylinder(Line inDirection, Vector3D inUVector, double inLength, double inWidth)
inDirection - the direction (middle axis of the cylinder)inUVector - the approximative U vector of the frame : corrected to be orthogonal to the directioninLength - dimension on the U axisinWidth - dimension on the V axisIllegalArgumentException - if one of the dimensions is negative or null, or if the direction vector has a null norm.public InfiniteRectangleCylinder(Vector3D inOrigin, Vector3D inDirection, Vector3D inUvector, double inLength, double inWidth)
inOrigin - the origin of the axisinDirection - the direction of the axisinUvector - the approximative U vector of the frameinLength - dimension on the U axisinWidth - dimension on the V axisIllegalArgumentException - if one of the dimensions is negative or nullpublic Vector3D getOrigin()
public Vector3D getDirection()
public Vector3D getU()
public Vector3D getV()
public double getLength()
public double getWidth()
public boolean intersects(Line line)
intersects in interface Shapeline - the linepublic Vector3D[] getIntersectionPoints(Line line)
getIntersectionPoints in interface Shapeline - the linepublic double distanceTo(Line line)
distanceTo in interface Shapeline - the linepublic Vector3D[] closestPointTo(Line line)
closestPointTo in interface Shapeline - the lineCopyright © 2025 CNES. All rights reserved.