public abstract class LineSegment extends AbstractCurve<LineSegment> implements PointGeometry<LineSegment>
Modified by: Joseph A. Huwaldt
GTOL
RESOURCES
Constructor and Description |
---|
LineSegment() |
Modifier and Type | Method and Description |
---|---|
PointString<SubrangePoint> |
extractGrid(GridRule gridRule,
java.util.List<java.lang.Double> spacing)
Return a string of points that are gridded onto the curve using the specified
spacing and gridding rule.
|
Parameter<Length> |
getArcLength(double s1,
double s2,
double eps)
Return the arc length of a segment of this curve.
|
Parameter |
getCurvature(double s)
Return the curvature (kappa = 1/rho; where rho = the radius of curvature) of the
curve at the parametric position
s . |
abstract GeomVector<Length> |
getDerivativeVector()
Return the dimensional direction/derivative vector for this line segment.
|
abstract GeomPoint |
getEnd()
Return the end point of the line segment.
|
SubrangePoint |
getLimitPoint(int dim,
boolean max,
double tol)
Returns the most extreme point, either minimum or maximum, in the specified
coordinate direction on this curve.
|
int |
getNumberOfPoints()
Return the total number of points in this geometry element.
|
int |
getPhyDimension()
Returns the number of physical dimensions of the geometry element.
|
SubrangePoint |
getPointAtArcLength(Parameter<Length> targetArcLength,
double tol)
Return a subrange point at the position on the curve with the specified arc-length.
|
abstract GeomPoint |
getStart()
Return the starting point of the line segment.
|
Parameter |
getTorsion(double s)
Return the torsion of the curve at the parametric position
s . |
LineSegTrans |
getTransformed(GTransform transform)
Returns transformed version of this element.
|
Unit<Length> |
getUnit()
Returns the unit in which this curve is stated.
|
abstract GeomVector<Dimensionless> |
getUnitVector()
Get unit direction vector for the line segment.
|
Parameter |
getVariationOfCurvature(double s)
Return the variation of curvature or rate of change of curvature (VOC or
dKappa(s)/ds) at the parametric position
s . |
PointString<SubrangePoint> |
gridToTolerance(Parameter<Length> tol)
Return a string of points that are gridded onto the curve with the number of points
and spacing chosen to result in straight line segments between the points that have
mid-points that are all within the specified tolerance of this curve.
|
PointString<SubrangePoint> |
intersect(GeomPlane plane,
double tol)
Return the intersection between a plane and this curve.
|
GeomList<PointString<SubrangePoint>> |
intersect(LineSegment line,
Parameter<Length> tol)
Return the intersection between a line segment and this curve.
|
boolean |
isCircular(Parameter<Length> tol)
Returns
true if this curve is a circular arc to within the specified
tolerance. |
boolean |
isLine(Parameter<Length> tol)
Returns
true if this curve is a line to within the specified
tolerance. |
boolean |
isPlanar(Parameter<Length> tol)
Return
true if this curve is planar or false if it is
not. |
boolean |
isValid()
Return
true if this LineSegment contains valid and finite numerical
components. |
int |
size()
Returns the number of child-elements that make up this geometry element.
|
GeomList<LineSegment> |
splitAt(double s)
Split this curve at the specified parametric position returning a list containing
two curves (a lower curve with smaller parametric positions than "s" and an upper
curve with larger parametric positions).
|
abstract LineSegment |
to(Unit<Length> unit)
Returns the equivalent to this LineSegment object but stated in the specified
unit.
|
NurbsCurve |
toNurbs()
Return a NURBS curve representation of this line segment.
|
NurbsCurve |
toNurbs(Parameter<Length> tol)
Return a NURBS curve representation of this line segment.
|
javolution.text.Text |
toText()
Returns the text representation of this geometry element that consists of the name
followed by the start and end points.
|
getArcLength, 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, equals, getAllUserData, getID, getName, getUserData, hashCode, putAllUserData, putUserData, removeChangeListener, removeUserData, reset, setName, toString
addChangeListener, copy, copyToReal, getAllUserData, getBoundsMax, getBoundsMin, getID, getName, getParDimension, getUserData, putAllUserData, putUserData, removeChangeListener, removeUserData, setName, toDimension
copy, copyToReal, getRealPoint, getSDerivatives, reverse, toDimension
public LineSegment()
public abstract GeomPoint getStart()
public abstract GeomPoint getEnd()
public abstract GeomVector<Dimensionless> getUnitVector()
public abstract GeomVector<Length> getDerivativeVector()
public int size()
size
in interface GeomElement<LineSegment>
public int getPhyDimension()
getPhyDimension
in interface GeomElement<LineSegment>
public int getNumberOfPoints()
getNumberOfPoints
in interface PointGeometry<LineSegment>
public GeomList<LineSegment> splitAt(double s)
splitAt
in interface Curve<LineSegment>
s
- The parametric position where this curve should be split (must not be 0 or
1!).public Parameter getCurvature(double s)
s
. This implementation always returns
zero.getCurvature
in interface Curve<LineSegment>
getCurvature
in class AbstractCurve<LineSegment>
s
- Parametric distance to calculate the curvature for (0.0 to 1.0 inclusive).public Parameter getVariationOfCurvature(double s)
s
. The VOC for a line segment
is always zero.getVariationOfCurvature
in interface Curve<LineSegment>
getVariationOfCurvature
in class AbstractCurve<LineSegment>
s
- Parametric distance to calculate the variation of curvature for (0.0 to
1.0 inclusive).public Parameter getTorsion(double s)
s
. The
torsion is a measure of the rotation or twist about the tangent vector. Torsion for
a line segment is always zero.getTorsion
in interface Curve<LineSegment>
getTorsion
in class AbstractCurve<LineSegment>
s
- Parametric distance to calculate the torsion for (0.0 to 1.0 inclusive).public Parameter<Length> getArcLength(double s1, double s2, double eps)
getArcLength
in interface Curve<LineSegment>
getArcLength
in class AbstractCurve<LineSegment>
s1
- The starting parametric distance along the curve to begin the arc-length
calculation from.s2
- The ending parametric distance along the curve to end the arc-length
calculation at.eps
- The desired fractional accuracy on the arc-length. For this curve type,
this parameter is ignored and the exact arc length is returned.public SubrangePoint getPointAtArcLength(Parameter<Length> targetArcLength, double tol)
getPointAtArcLength
in interface Curve<LineSegment>
getPointAtArcLength
in class AbstractCurve<LineSegment>
targetArcLength
- The target arc length to find in meters. May not be null.tol
- Fractional tolerance (in parameter space) to refine the
point position to. For this curve, this parameter is ignored
and the exact point position is always returned.public PointString<SubrangePoint> extractGrid(GridRule gridRule, java.util.List<java.lang.Double> spacing)
extractGrid
in interface Curve<LineSegment>
extractGrid
in class AbstractCurve<LineSegment>
gridRule
- Specifies whether the subdivision spacing is applied with respect
to arc-length in real space or parameter space. May not be null.spacing
- A list of values used to define the subdivision spacing.
gridRule
specifies whether the subdivision spacing is
applied with respect to arc-length in real space or parameter
space. If the spacing is arc-length, then the values are
interpreted as fractions of the arc length of the curve from 0 to
1. May not be null.public PointString<SubrangePoint> gridToTolerance(Parameter<Length> tol)
gridToTolerance
in interface Curve<LineSegment>
gridToTolerance
in class AbstractCurve<LineSegment>
tol
- The maximum distance that a straight line between gridded points may
deviate from this curve. Ignored by this implementation.public PointString<SubrangePoint> intersect(GeomPlane plane, double tol)
intersect
in interface Curve<LineSegment>
intersect
in class AbstractCurve<LineSegment>
plane
- The plane to intersect with this curve. May not be null.tol
- Fractional tolerance (in parameter space) to refine the point
positions to. For this curve, this parameter is ignored and the exact
point positions are returned.public GeomList<PointString<SubrangePoint>> intersect(LineSegment line, Parameter<Length> tol)
intersect
in interface Curve<LineSegment>
intersect
in class AbstractCurve<LineSegment>
line
- The line segment to intersect. May not be null.tol
- Tolerance (in physical space) to refine the point positions to. A null
value indicates an exact intersection is required.public SubrangePoint getLimitPoint(int dim, boolean max, double tol)
getLimitPoint
in interface GeomElement<LineSegment>
getLimitPoint
in class AbstractCurve<LineSegment>
dim
- An index indicating the dimension to find the min/max point for (0=X,
1=Y, 2=Z, etc).max
- Set to true
to return the maximum value, false
to return the minimum.tol
- Fractional tolerance (in parameter space) to refine the min/max point
position to.GeomElement.getBoundsMin()
,
GeomElement.getBoundsMax()
public boolean isValid()
true
if this LineSegment contains valid and finite numerical
components. A value of false
will be returned if any of the coordinate
values are NaN or Inf.isValid
in interface GeomElement<LineSegment>
public boolean isLine(Parameter<Length> tol)
true
if this curve is a line to within the specified
tolerance. This implementation always returns true
if the line is not
degenerate.isLine
in interface Curve<LineSegment>
isLine
in class AbstractCurve<LineSegment>
tol
- The tolerance for determining if this curve is a line. May not be null.true
if the line is not degenerate.public boolean isPlanar(Parameter<Length> tol)
true
if this curve is planar or false
if it is
not. This implementation always returns true
isPlanar
in interface Curve<LineSegment>
isPlanar
in class AbstractCurve<LineSegment>
tol
- The geometric tolerance to use in determining if the curve is planar.
Ignored by this implementation.public boolean isCircular(Parameter<Length> tol)
true
if this curve is a circular arc to within the specified
tolerance. This implementation always returns false
.isCircular
in interface Curve<LineSegment>
isCircular
in class AbstractCurve<LineSegment>
tol
- The tolerance for determining if this curve is a circular arc.
Ignored by this implementation.public LineSegTrans getTransformed(GTransform transform)
GeomTransform
and contains this element as a child.getTransformed
in interface Transformable<LineSegment>
transform
- The transformation to apply to this geometry. May not be null.DimensionException
- if this point is not 3D.public Unit<Length> getUnit()
getUnit
in interface GeomElement<LineSegment>
public NurbsCurve toNurbs(Parameter<Length> tol)
toNurbs
in interface Curve<LineSegment>
tol
- Ignored. May pass null
.public NurbsCurve toNurbs()
public javolution.text.Text toText()
{aLine = {{0.0 m, 0.0 m},{1.0 , 0.0 }}If there is no name, then the output looks like this:
{{0.0 m, 0.0 m},{1.0 , 0.0 }}
toText
in interface GeomElement<LineSegment>
toText
in class AbstractGeomElement<LineSegment>
public abstract LineSegment 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>
unit
- the length unit of the line segment to be returned. May not be null.ConversionException
- if the the input unit is not a length unit.