public final class LineSeg extends LineSegment implements javolution.lang.ValueType
Modified by: Joseph A. Huwaldt
GTOL
RESOURCES
Modifier and Type | Method and Description |
---|---|
LineSeg |
copy()
Returns a copy of this LineSeg instance
allocated
by the calling thread (possibly on the stack). |
LineSeg |
copyToReal()
Return a copy of this object with any transformations or subranges
removed (applied).
|
boolean |
equals(java.lang.Object obj)
Compares this LineSeg against the specified object for strict
equality.
|
Parameter<Length> |
getArcLength(double eps)
Return the total arc length of this curve.
|
Point |
getBoundsMax()
Return the coordinate point representing the
maximum bounding box corner (e.g.: max X, max Y, max Z).
|
Point |
getBoundsMin()
Return the coordinate point representing the
minimum bounding box corner of this geometry element (e.g.: min X, min Y, min Z).
|
GeomVector<Length> |
getDerivativeVector()
Return the dimensional derivative vector for this line segment.
|
Point |
getEnd()
Return the end point of the line segment.
|
Point |
getRealPoint(double s)
Calculate a point on the curve for the given parametric distance
along the curve.
|
java.util.List<Vector<Length>> |
getSDerivatives(double s,
int grade)
Calculate all the derivatives from
0 to grade with respect
to parametric distance on the curve for the given parametric distance along the curve,
d^{grade}p(s)/d^{grade}s . |
Point |
getStart()
Return the starting point of the line segment.
|
Vector<Dimensionless> |
getUnitVector()
Get a unit direction vector for the line segment.
|
int |
hashCode()
Returns the hash code for this parameter.
|
static void |
recycle(LineSeg instance)
Recycles a
LineSeg instance immediately (on the stack when
executing in a StackContext ). |
LineSegment |
reverse()
Return a new curve that is identical to this one, but with the
parameterization reversed.
|
LineSeg |
to(Unit<Length> unit)
Returns the equivalent to this element but stated in the
specified unit.
|
LineSeg |
toDimension(int newDim)
Return a copy of this curve converted to the specified number
of physical dimensions.
|
static LineSeg |
valueOf(Curve lineCrv)
Returns a
LineSeg that represents a straight line between the end
points of the input curve. |
static LineSeg |
valueOf(Point p0,
GeomVector<Length> Ldir)
Returns a
LineSeg instance with the specified start point and
direction/length vector. |
static LineSeg |
valueOf(Point p0,
Point p1)
Returns a
LineSeg instance with the specified end points. |
extractGrid, getArcLength, getCurvature, getLimitPoint, getNumberOfPoints, getPhyDimension, getPointAtArcLength, getTorsion, getTransformed, getUnit, getVariationOfCurvature, gridToTolerance, intersect, intersect, isCircular, isLine, isPlanar, isValid, size, splitAt, toNurbs, toNurbs, toText
getArcLength, getBinormal, getBinormal, getClosest, getClosest, getClosest, getClosest, getClosest, getClosest, getCurvature, getDerivatives, getEnclosedArea, getFarthest, getFarthest, getFarthest, getParDimension, getPoint, getPoint, getPrincipalNormal, getPrincipalNormal, getRealPoint, getSDerivative, getSDerivatives, getTangencyPoint, getTangent, getTangent, getTorsion, getVariationOfCurvature, intersect, intersect, intersect, isDegenerate, splitAt
addChangeListener, clone, compareTo, getAllUserData, getID, getName, getUserData, putAllUserData, putUserData, removeChangeListener, removeUserData, reset, setName, toString
addChangeListener, getAllUserData, getID, getName, getParDimension, getUserData, putAllUserData, putUserData, removeChangeListener, removeUserData, setName
public static LineSeg valueOf(Point p0, Point p1)
LineSeg
instance with the specified end points.
The units of the curve will be the units of the start point.p0
- The start (beginning) of the line segment. May not be null.p1
- The end of the line segment. May not be null.LineSeg
instance that represents a line between the input points.public static LineSeg valueOf(Point p0, GeomVector<Length> Ldir)
LineSeg
instance with the specified start point and
direction/length vector. The units of the curve will be the units of the start
point.p0
- The start (beginning) of the line segment. May not be null.Ldir
- The vector defining the direction and length of the line segment. May
not be null.public static LineSeg valueOf(Curve lineCrv)
LineSeg
that represents a straight line between the end
points of the input curve. WARNING: No check is made that the input curve is truly
a straight line. The end points of the input curve are simply used to define a
straight line segment.lineCrv
- A curve from which the end points will be used to define a line
segment. May not be null.Curve.isLine(jahuwaldt.js.param.Parameter<javax.measure.quantity.Length>)
public static void recycle(LineSeg instance)
LineSeg
instance immediately (on the stack when
executing in a StackContext
).instance
- The instance to recycle immediately.public Point getStart()
getStart
in class LineSegment
public Point getEnd()
getEnd
in class LineSegment
public Vector<Dimensionless> getUnitVector()
getUnitVector
in class LineSegment
public GeomVector<Length> getDerivativeVector()
getDerivativeVector
in class LineSegment
public Point getRealPoint(double s)
getRealPoint
in interface Curve<LineSegment>
s
- parametric distance to calculate a point for (0.0 to 1.0 inclusive).public java.util.List<Vector<Length>> getSDerivatives(double s, int grade)
0
to grade
with respect
to parametric distance on the curve for the given parametric distance along the curve,
d^{grade}p(s)/d^{grade}s
.
Example:
1st derivative (grade = 1), this returns [p(s), dp(s)/ds]
;
2nd derivative (grade = 2), this returns [p(s), dp(s)/ds, d^2p(s)/d^2s]
; etc.
getSDerivatives
in interface Curve<LineSegment>
s
- Parametric distance to calculate derivatives for (0.0 to 1.0 inclusive).grade
- The maximum grade to calculate the derivatives for (1=1st derivative, 2=2nd derivative, etc)java.lang.IllegalArgumentException
- if the grade is < 0.public Parameter<Length> getArcLength(double eps)
getArcLength
in interface Curve<LineSegment>
getArcLength
in class AbstractCurve<LineSegment>
eps
- The desired fractional accuracy on the arc-length. For this
curve type, this parameter is ignored and the exact arc
length is always returned.public LineSegment reverse()
reverse
in interface Curve<LineSegment>
public Point getBoundsMin()
getBoundsMin
in interface GeomElement<LineSegment>
public Point getBoundsMax()
getBoundsMax
in interface GeomElement<LineSegment>
public LineSeg toDimension(int newDim)
toDimension
in interface Curve<LineSegment>
toDimension
in interface GeomElement<LineSegment>
toDimension
in interface ParametricGeometry<LineSegment>
newDim
- The dimension of the curve to return.public LineSeg to(Unit<Length> unit) throws ConversionException
to
in interface Curve<LineSegment>
to
in interface GeomElement<LineSegment>
to
in interface ParametricGeometry<LineSegment>
to
in interface PointGeometry<LineSegment>
to
in class LineSegment
unit
- the length unit of the element to be returned. May not be null.ConversionException
- if the the input unit is not a length unit.public LineSeg copy()
allocated
by the calling thread (possibly on the stack).copy
in interface Curve<LineSegment>
copy
in interface GeomElement<LineSegment>
copy
in interface ParametricGeometry<LineSegment>
copy
in interface javolution.lang.ValueType
public LineSeg copyToReal()
copyToReal
in interface Curve<LineSegment>
copyToReal
in interface GeomElement<LineSegment>
public boolean equals(java.lang.Object obj)
equals
in class AbstractGeomElement<LineSegment>
obj
- the object to compare with.true
if this LineSeg is identical to that
LineSeg; false
otherwise.public int hashCode()
hashCode
in class AbstractGeomElement<LineSegment>