public class LineSegment3DFloat
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
BoundingBox3DFloat |
bbox
The bounding box of this line.
|
Point3DFloat |
p1
The endpoints of the line.
|
Point3DFloat |
p2
The endpoints of the line.
|
Constructor and Description |
---|
LineSegment3DFloat(float x1,
float y1,
float z1,
float x2,
float y2,
float z2)
Construct a line segment with the 2 specified endpoints.
|
LineSegment3DFloat(Point3DFloat p1,
Point3DFloat p2)
Construct a line segment with the 2 specified endpoints.
|
Modifier and Type | Method and Description |
---|---|
float |
distance(float px,
float py,
float pz)
Calculate the distance from this finite line segment to the specified
point in 3D.
|
float |
distance(Point3DFloat p)
Calculate the distance from this finite line segment to the specified
point in 3D.
|
float |
distanceToLine(Point3DFloat p)
Calculate the distance from an infinite line (not a line segment!) to
the specified point in 3D.
|
BoundingBox3DFloat |
getBoundingBox()
Gets the bounding box of this line segment.
|
boolean |
inCylinder(float px,
float py,
float pz,
float radius)
Returns true if the point is within an uncapped finite cylinder
surrounding the line segment with the specified radius.
|
boolean |
inTaperedCappedCylinder(float px,
float py,
float pz,
float radius1,
float radius2)
Returns true if the specified point is within a tapered cylinder with
spherical endcaps.
|
boolean |
inTaperedCylinder(float px,
float py,
float pz,
float radius1,
float radius2)
Returns true if the point (px, py, pz) is within an uncapped finite
tapered cylinder surrounding the line segment with the specified radii
at the endpoints.
|
static LineSegment3DFloat |
pointAndNormal(float x,
float y,
float z,
float nx,
float ny,
float nz)
Construct a line segment from a point and a normal vector (this
function will normalize the normal.) The line segment will be of
length 1.
|
static LineSegment3DFloat |
pointAndNormal(float x,
float y,
float z,
float nx,
float ny,
float nz,
float d0,
float d1)
Construct a line segment from a point and a normal vector (this
function will normalize the normal.) The line segment will extend
along the normal with the specified start and end distances d0 and d1
from the starting point.
|
static LineSegment3DFloat |
towardPoint(float x1,
float y1,
float z1,
float x2,
float y2,
float z2,
float d0,
float d1)
Makes a line segment from point 1 toward point 2.
|
public Point3DFloat p1
public Point3DFloat p2
public BoundingBox3DFloat bbox
public LineSegment3DFloat(Point3DFloat p1, Point3DFloat p2)
public LineSegment3DFloat(float x1, float y1, float z1, float x2, float y2, float z2)
public static LineSegment3DFloat pointAndNormal(float x, float y, float z, float nx, float ny, float nz)
public static LineSegment3DFloat pointAndNormal(float x, float y, float z, float nx, float ny, float nz, float d0, float d1)
public static LineSegment3DFloat towardPoint(float x1, float y1, float z1, float x2, float y2, float z2, float d0, float d1)
public float distance(Point3DFloat p)
public float distance(float px, float py, float pz)
public float distanceToLine(Point3DFloat p)
public boolean inCylinder(float px, float py, float pz, float radius)
public boolean inTaperedCylinder(float px, float py, float pz, float radius1, float radius2)
public boolean inTaperedCappedCylinder(float px, float py, float pz, float radius1, float radius2)
public BoundingBox3DFloat getBoundingBox()