T
- The type of this curve.public interface Curve<T extends Curve> extends GeomElement<T>, ParametricGeometry<T>, Transformable<T>
GeomElement
objects that are continuous curves.
Modified by: Joseph A. Huwaldt
Modifier and Type | Method and Description |
---|---|
T |
copy()
Returns a copy of this curve instance
allocated by the calling thread
(possibly on the stack). |
T |
copyToReal()
Return a copy of this object with any transformations or subranges removed
(applied).
|
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 eps)
Return the total arc length of this curve.
|
Parameter<Length> |
getArcLength(double s1,
double s2,
double eps)
Return the arc length of a segment of this curve.
|
Parameter<Length> |
getArcLength(GeomPoint s1,
GeomPoint s2,
double eps)
Return the arc length of a segment of this curve.
|
Vector<Dimensionless> |
getBinormal(double s)
Return the binormal vector for the given parametric distance along the curve.
|
Vector<Dimensionless> |
getBinormal(GeomPoint s)
Return the binormal vector for the given parametric distance along the curve.
|
PointString<SubrangePoint> |
getClosest(Curve curve,
double tol)
Returns the closest points (giving the minimum distance) between this curve and the
specified curve.
|
SubrangePoint |
getClosest(GeomPlane plane,
double tol)
Returns the closest points (giving the minimum distance) between this curve and the
specified plane.
|
SubrangePoint |
getClosest(GeomPoint point,
double tol)
Returns the closest point on this curve to the specified point.
|
SubrangePoint |
getClosest(GeomPoint point,
double near,
double tol)
Returns the closest point on this curve to the specified point near the specified
parametric position.
|
PointString<SubrangePoint> |
getClosest(java.util.List<? extends GeomPoint> points,
double tol)
Returns the closest points on this curve to the specified list of points.
|
PointString<SubrangePoint> |
getClosest(Surface surface,
double tol)
Returns the closest points (giving the minimum distance) between this curve and the
specified surface.
|
Parameter |
getCurvature(double s)
Return the curvature (kappa = 1/rho; where rho = the radius of curvature) of the
curve at the parametric position
s . |
Parameter |
getCurvature(GeomPoint s)
Return the curvature (kappa = 1/rho; where rho = the radius of curvature) of the
curve at the parametric position
s . |
java.util.List<java.util.List<Vector<Length>>> |
getDerivatives(GeomPoint s,
int grade)
Calculate all the derivatives from
0 to grade with
respect to parametric position(s) on a parametric object for the given parametric
position on the object, d^{grade}p(s)/d^{grade}s . |
Parameter<Area> |
getEnclosedArea(GeomPoint refPnt,
double eps)
Return the signed area of the region enclosed or subtended by a planar curve
relative to the specified reference point.
|
SubrangePoint |
getFarthest(GeomPoint point,
double tol)
Returns the farthest point on this curve from the specified point.
|
SubrangePoint |
getFarthest(GeomPoint point,
double near,
double tol)
Returns the farthest point on this curve from the specified point near the
specified parametric position.
|
PointString<SubrangePoint> |
getFarthest(java.util.List<? extends GeomPoint> points,
double tol)
Returns the farthest points on this curve to the specified list of points.
|
SubrangePoint |
getPoint(double s)
Return a subrange point on the curve for the given parametric distance along the
curve.
|
SubrangePoint |
getPoint(GeomPoint s)
Return a subrange point on the curve for the given parametric distance along the
curve.
|
SubrangePoint |
getPointAtArcLength(Parameter<Length> arcLength,
double tol)
Return a subrange point at the position on the curve with the specified arc-length.
|
Vector<Dimensionless> |
getPrincipalNormal(double s)
Return the principal normal vector for the given parametric distance,
s , along the curve. |
Vector<Dimensionless> |
getPrincipalNormal(GeomPoint s)
Return the principal normal vector for the given parametric distance,
s , along the curve. |
Point |
getRealPoint(double s)
Calculate a point on the curve for the given parametric distance along the curve.
|
Point |
getRealPoint(GeomPoint s)
Calculate a point on the curve for the given parametric distance along the curve.
|
Vector<Length> |
getSDerivative(double s,
int grade)
Calculate a derivative with respect to parametric distance of the given grade on
the curve for the given parametric distance along the curve,
d^{grade}p(s)/d^{grade}s . |
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 . |
java.util.List<Vector<Length>> |
getSDerivatives(GeomPoint 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 . |
SubrangePoint |
getTangencyPoint(GeomPoint point,
double near,
double tol)
A point is found along this curve that when connected by a straight line to the
given point in space, the resulting line is tangent to this curve.
|
Vector<Dimensionless> |
getTangent(double s)
Return the tangent vector for the given parametric distance along the curve.
|
Vector<Dimensionless> |
getTangent(GeomPoint s)
Return the tangent vector for the given parametric distance along the curve.
|
Parameter |
getTorsion(double s)
Return the torsion of the curve at the parametric position
s . |
Parameter |
getTorsion(GeomPoint s)
Return the torsion of the curve at the parametric position
s . |
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 . |
Parameter |
getVariationOfCurvature(GeomPoint 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 are
within the specified tolerance of this curve.
|
GeomList<PointString<SubrangePoint>> |
intersect(Curve curve,
Parameter<Length> tol)
Return the intersection between another curve and this curve.
|
PointString<SubrangePoint> |
intersect(GeomPlane plane,
double tol)
Return the intersection between a plane and this curve.
|
PointString<SubrangePoint> |
intersect(GeomPoint L0,
GeomVector Ldir,
Parameter<Length> tol)
Return the intersection between an infinite line and this curve.
|
GeomList<PointString<SubrangePoint>> |
intersect(LineSegment line,
Parameter<Length> tol)
Return the intersection between a line segment and this curve.
|
GeomList<PointString<SubrangePoint>> |
intersect(Surface surface,
Parameter<Length> tol)
Return the intersections between a surface and this curve.
|
boolean |
isCircular(Parameter<Length> tol)
Returns
true if this curve is a circular arc to within the specified
tolerance. |
boolean |
isDegenerate(Parameter<Length> tol)
Return
true if this curve is degenerate (i.e.: has length less than
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. |
T |
reverse()
Return a new curve that is identical to this one, but with the parameterization
reversed.
|
GeomList<T> |
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).
|
GeomList<T> |
splitAt(GeomPoint 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).
|
T |
to(Unit<Length> unit)
Returns the equivalent to this curve but stated in the specified unit.
|
T |
toDimension(int newDim)
Return a copy of this curve converted to the specified number of physical
dimensions.
|
NurbsCurve |
toNurbs(Parameter<Length> tol)
Return a NURBS curve representation of this curve to within the specified
tolerance.
|
getTransformed
addChangeListener, getAllUserData, getBoundsMax, getBoundsMin, getID, getLimitPoint, getName, getParDimension, getPhyDimension, getUnit, getUserData, isValid, putAllUserData, putUserData, removeChangeListener, removeUserData, setName, size, toText
T to(Unit<Length> unit) throws ConversionException
to
in interface GeomElement<T extends Curve>
to
in interface ParametricGeometry<T extends Curve>
unit
- the length unit of the curve to be returned.ConversionException
- if the the input unit is not a length unit.T toDimension(int newDim)
toDimension
in interface GeomElement<T extends Curve>
toDimension
in interface ParametricGeometry<T extends Curve>
newDim
- The dimension of the curve to return.T copy()
allocated
by the calling thread
(possibly on the stack).copy
in interface GeomElement<T extends Curve>
copy
in interface ParametricGeometry<T extends Curve>
T copyToReal()
copyToReal
in interface GeomElement<T extends Curve>
T reverse()
NurbsCurve toNurbs(Parameter<Length> tol)
tol
- The greatest possible difference between this curve and the NURBS
representation returned.GeomList<T> splitAt(double s)
s
- The parametric position where this curve should be split (must not be 0 or
1!).GeomList<T> splitAt(GeomPoint s)
s
- The parametric position where this curve should be split (must not be 0 or
1!). Must be a 1-dimensional point with a value in the range 0 to 1.0,
non-inclusive. Units are ignored.SubrangePoint getPoint(double s)
s
- parametric distance to calculate a point for (0.0 to 1.0 inclusive).null
if the parameter is not in a valid
range.SubrangePoint getPoint(GeomPoint s)
getPoint
in interface ParametricGeometry<T extends Curve>
s
- parametric distance to calculate a point for. Must be a 1-dimensional
point with a value in the range 0 to 1.0. Units are ignored.Point getRealPoint(double s)
s
- parametric distance to calculate a point for (0.0 to 1.0 inclusive).Point getRealPoint(GeomPoint s)
getRealPoint
in interface ParametricGeometry<T extends Curve>
s
- parametric distance to calculate a point for. Must be a 1-dimensional
point with a value in the range 0 to 1.0. Units are ignored.java.util.List<java.util.List<Vector<Length>>> getDerivatives(GeomPoint s, int grade)
0
to grade
with
respect to parametric position(s) on a parametric object for the given parametric
position on the object, 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.
getDerivatives
in interface ParametricGeometry<T extends Curve>
s
- parametric position to calculate the derivatives for. Must match the
parametric dimension of this parametric surface and have each value in
the range 0 to 1.0. Units are ignored.grade
- The maximum grade to calculate the derivatives for (1=1st derivative,
2=2nd derivative, etc)java.lang.IllegalArgumentException
- if the grade is < 0.Vector<Length> getSDerivative(double s, int grade)
d^{grade}p(s)/d^{grade}s
.
Example:
1st derivative (grade = 1), this returns dp(s)/ds
;
2nd derivative (grade = 2), this returns d^2p(s)/d^2s
; etc.
derivative = curve.getDerivative(s, 1); dy/dx = (dy/ds)/(dx/ds) = derivative.getValue(1)/derivative.getValue(0), dy/dz = (dy/ds)/(dz/ds) = derivative.getValue(1)/derivative.getValue(2), etc
s
- Parametric distance to calculate a derivative for (0.0 to 1.0
inclusive).grade
- The grade to calculate the derivative for (1=1st derivative, 2=2nd
derivative, etc)java.lang.IllegalArgumentException
- if the grade is < 0.java.util.List<Vector<Length>> getSDerivatives(GeomPoint 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.
s
- parametric distance to calculate the derivatives for. Must be a
1-dimensional point with a value in the range 0 to 1.0. Units are
ignored.grade
- The maximum grade to calculate the derivatives for (1=1st derivative,
2=2nd derivative, etc)java.lang.IllegalArgumentException
- if the grade is < 0.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.
s
- Parametric distance to calculate the 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.Vector<Dimensionless> getTangent(double s)
Note: Cartesian space derivatives can be calculated as follows:
tangent = curve.getTangent(s); dy/dx = (dy/ds)/(dx/ds) = tangent.getValue(1)/tangent.getValue(0), dy/dz = (dy/ds)/(dz/ds) = tangent.getValue(1)/tangent.getValue(2), etc
s
- Parametric distance to calculate a tangent vector for (0.0 to 1.0
inclusive).Vector<Dimensionless> getTangent(GeomPoint s)
Note: Cartesian space derivatives can be calculated as follows:
tangent = curve.getTangent(s); dy/dx = (dy/ds)/(dx/ds) = tangent.getValue(1)/tangent.getValue(0), dy/dz = (dy/ds)/(dz/ds) = tangent.getValue(1)/tangent.getValue(2), etc
s
- Parametric distance to calculate a tangent vector for. Must be a
1-dimensional point with a value in the range 0 to 1.0. Units are ignored.Vector<Dimensionless> getPrincipalNormal(double s)
s
, along the curve. This vector is normal to the curve, lies in the
normal plane (is perpendicular to the tangent vector), and points toward the center
of curvature at the specified point.s
- Parametric distance to calculate the principal normal vector for (0.0 to
1.0 inclusive).java.lang.IllegalArgumentException
- if the curve does not have a 2nd derivative with
respect to s
(if the curve is locally a straight line segment -- this
means there are an infinite number of possible principal normal vectors).Vector<Dimensionless> getPrincipalNormal(GeomPoint s)
s
, along the curve. This vector is normal to the curve, lies in the
normal plane (is perpendicular to the tangent vector), and points toward the center
of curvature at the specified point.s
- Parametric distance to calculate the principal normal vector for. Must be
a 1-dimensional point with a value in the range 0 to 1.0. Units are
ignored.java.lang.IllegalArgumentException
- if the curve does not have a 2nd derivative with
respect to s
(if the curve is locally a straight line segment -- this
means there are an infinite number of possible principal normal vectors).Vector<Dimensionless> getBinormal(double s) throws DimensionException
s
, lies in the normal plane (is
perpendicular to the tangent vector), and is perpendicular to the principal normal
vector. Together, the tangent vector, principal normal vector, and binormal vector
form a useful orthogonal frame.s
- Parametric distance to calculate the binormal vector for (0.0 to 1.0
inclusive).java.lang.IllegalArgumentException
- if the curve does not have a 2nd derivative with
respect to s
(if the curve is locally a straight line segment).DimensionException
- if the curve does not have at least 3 physical
dimensions.Vector<Dimensionless> getBinormal(GeomPoint s) throws DimensionException
s
, lies in the normal plane (is
perpendicular to the tangent vector), and is perpendicular to the principal normal
vector. Together, the tangent vector, principal normal vector, and binormal vector
form a useful orthogonal frame.s
- Parametric distance to calculate the binormal vector for. Must be a
1-dimensional point with a value in the range 0 to 1.0. Units are ignored.java.lang.IllegalArgumentException
- if the curve does not have a 2nd derivative with
respect to s
(if the curve is locally a straight line segment).DimensionException
- if the curve does not have at least 3 physical
dimensions.Parameter getCurvature(double s)
s
. The curvature vector (vector from
p(s) to the center of curvature) can be constructed from: k = rhoi*ni
or k = curve.getPrincipalNormal(s).divide(curve.getCurvature(s));
s
- Parametric distance to calculate the curvature for (0.0 to 1.0 inclusive).Parameter getCurvature(GeomPoint s)
s
. The curvature vector (vector from
p(s) to the center of curvature) can be constructed from: k = rhoi*ni
or k = curve.getPrincipalNormal(s).divide(curve.getCurvature(s));
s
- Parametric distance to calculate the curvature for. Must be a
1-dimensional point with a value in the range 0 to 1.0. Units are ignored.Parameter getVariationOfCurvature(double s)
s
.s
- Parametric distance to calculate the variation of curvature for (0.0 to
1.0 inclusive).Parameter getVariationOfCurvature(GeomPoint s)
s
.s
- Parametric distance to calculate the variation of curvature for. Must be a
1-dimensional point with a value in the range 0 to 1.0. Units are ignored.Parameter getTorsion(double s)
s
. The
torsion is a measure of the rotation or twist about the tangent vector.s
- Parametric distance to calculate the torsion for (0.0 to 1.0 inclusive).Parameter getTorsion(GeomPoint s)
s
. The
torsion is a measure of the rotation or twist about the tangent vector.s
- Parametric distance to calculate the torsion for. Must be a 1-dimensional
point with a value in the range 0 to 1.0. Units are ignored.Parameter<Length> getArcLength(double eps)
eps
- The desired fractional accuracy on the arc-length.Parameter<Length> getArcLength(double s1, double s2, double eps)
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.Parameter<Length> getArcLength(GeomPoint s1, GeomPoint s2, double eps)
s1
- The starting parametric distance along the curve to begin the arc-length
calculation from. Must be a 1-dimensional point with a value in the
range 0 to 1.0. Units are ignored.s2
- The ending parametric distance along the curve to end the arc-length
calculation at. Must be a 1-dimensional point with a value in the range
0 to 1.0. Units are ignored.eps
- The desired fractional accuracy on the arc-length.SubrangePoint getPointAtArcLength(Parameter<Length> arcLength, double tol)
arcLength
- The target arc length to find in meters.tol
- Fractional tolerance (in parameter space) to refine the point
position to.SubrangePoint getTangencyPoint(GeomPoint point, double near, double tol)
point
- The point that the tangent on the curve is to be found relative to.near
- The parametric distance on the curve (0-1) that serves as an initial
guess at the location of the tangent point.tol
- Fractional tolerance (in parameter space) to refine the point position
to.PointString<SubrangePoint> extractGrid(GridRule gridRule, java.util.List<java.lang.Double> spacing)
gridRule
- Specifies whether the subdivision spacing is applied with respect
to arc-length in real space or parameter space.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.PointString<SubrangePoint> gridToTolerance(Parameter<Length> tol)
tol
- The maximum distance that a straight line between gridded points may
deviate from this curve.PointString<SubrangePoint> intersect(GeomPlane plane, double tol)
plane
- The plane to intersect with this curve.tol
- Fractional tolerance (in parameter space) to refine the point
positions to.PointString<SubrangePoint> intersect(GeomPoint L0, GeomVector Ldir, Parameter<Length> tol)
L0
- A point on the line (origin of the line).Ldir
- The direction vector for the line (does not have to be a unit vector).tol
- Tolerance (in physical space) to refine the point positions to.GeomList<PointString<SubrangePoint>> intersect(LineSegment line, Parameter<Length> tol)
line
- The line segment to intersect.tol
- Tolerance (in physical space) to refine the point positions to.GeomList<PointString<SubrangePoint>> intersect(Curve curve, Parameter<Length> tol)
curve
- The curve to intersect with this curve.tol
- Tolerance (in physical space) to refine the point positions to.GeomList<PointString<SubrangePoint>> intersect(Surface surface, Parameter<Length> tol)
surface
- The surface to intersect with this curve.tol
- Tolerance (in physical space) to refine the point positions to.SubrangePoint getClosest(GeomPoint point, double tol)
getClosest
in interface ParametricGeometry<T extends Curve>
point
- The point to find the closest point on this curve to.tol
- Fractional tolerance (in parameter space) to refine the point position
to.SubrangePoint
on this curve that is closest to the specified
point.SubrangePoint getClosest(GeomPoint point, double near, double tol)
point
- The point to find the closest point on this curve to.near
- The parametric position where the search for the closest point should
be started.tol
- Fractional tolerance (in parameter space) to refine the point position
to.PointString<SubrangePoint> getClosest(java.util.List<? extends GeomPoint> points, double tol)
points
- The list of points to find the closest points on this curve to.tol
- Fractional tolerance (in parameter space) to refine the point
positions to.SubrangePoint
objects on this curve that are closest to
the specified points.SubrangePoint getFarthest(GeomPoint point, double tol)
getFarthest
in interface ParametricGeometry<T extends Curve>
point
- The point to find the farthest point on this curve from.tol
- Fractional tolerance (in parameter space) to refine the point position
to.SubrangePoint
on this curve that is farthest from the specified
point.SubrangePoint getFarthest(GeomPoint point, double near, double tol)
point
- The point to find the farthest point on this curve from.near
- The parametric position where the search for the farthest point should
be started.tol
- Fractional tolerance (in parameter space) to refine the point position
to.SubrangePoint
on this curve that is farthest from the specified
point.PointString<SubrangePoint> getFarthest(java.util.List<? extends GeomPoint> points, double tol)
points
- The list of points to find the farthest points on this curve to.tol
- Fractional tolerance (in parameter space) to refine the point
positions to.SubrangePoint
objects on this curve that are farthest
from the specified points.PointString<SubrangePoint> getClosest(Curve curve, double tol)
curve
- The curve to find the closest points between this curve and that one.tol
- Fractional tolerance (in parameter space) to refine the point position
to.PointString<SubrangePoint> getClosest(Surface surface, double tol)
surface
- The surface to find the closest points between this curve and that
surface.tol
- Fractional tolerance (in parameter space) to refine the point
position to.SubrangePoint getClosest(GeomPlane plane, double tol)
plane
- The plane to find the closest points between this curve and that
plane.tol
- Fractional tolerance (in parameter space) to refine the point position
to.Parameter<Area> getEnclosedArea(GeomPoint refPnt, double eps)
refPnt
- The reference point used for computing the enclosed or subtended area
of the curve.eps
- The desired fractional accuracy of the area calculated.boolean isDegenerate(Parameter<Length> tol)
true
if this curve is degenerate (i.e.: has length less than
the specified tolerance).isDegenerate
in interface ParametricGeometry<T extends Curve>
tol
- The tolerance for determining if this curve is degenerate. May not be
null.boolean isPlanar(Parameter<Length> tol)
true
if this curve is planar or false
if it is
not.tol
- The geometric tolerance to use in determining if the curve is planar.boolean isLine(Parameter<Length> tol)
true
if this curve is a line to within the specified
tolerance.tol
- The tolerance for determining if this curve is a line.boolean isCircular(Parameter<Length> tol)
true
if this curve is a circular arc to within the specified
tolerance.tol
- The tolerance for determining if this curve is a circular arc.