public final class CurveFactory extends java.lang.Object
Modified by: Joseph A. Huwaldt
Modifier and Type | Method and Description |
---|---|
static BasicNurbsCurve |
approxPoints(int degree,
int nCP,
PointString<? extends GeomPoint> points)
Create a
NurbsCurve of the specified degree that approximates, in a least
squared error sense, the specified list of geometry points in the input order. |
static KnotVector |
buildInterpKnotVector(double[] uk,
int numPoints,
int p)
Create a vector of knots to go with the list of parameter values for a curve that
passes through a list of points.
|
static BasicNurbsCurve |
createBlend(GeomPoint p1,
GeomVector t1,
GeomPoint p2,
GeomVector t2,
boolean unitFlag,
double tanlen)
Create a potentially non-planar cubic Bezier
NurbsCurve that joins or
blends two end points with the specified tangent vectors at each end point. |
static BasicNurbsCurve |
createCircle(GeomPoint p1,
GeomPoint p2,
GeomPoint p3)
Create a full-circle
NurbsCurve that passes through the input (not
co-linear) points. |
static BasicNurbsCurve |
createCircle(GeomPoint o,
Parameter<Length> r,
GeomVector<Dimensionless> n)
Create a full-circle
NurbsCurve around the given origin/center with radius
r . |
static BasicNurbsCurve |
createCircleO(GeomPoint o,
GeomPoint p1,
GeomPoint p2)
Create a full-circle
NurbsCurve that is approximately centered on the
specified origin point and passes through the two input points. |
static BasicNurbsCurve |
createCircularArc(GeomPoint p1,
GeomPoint p2,
GeomPoint p3)
Create a circular arc
NurbsCurve that passes through the input (not
co-linear) points. |
static BasicNurbsCurve |
createCircularArc(GeomPoint p1,
GeomVector t1,
GeomPoint p2)
Create a circular arc
NurbsCurve that passes through the input points and
that has the input tangents at the 1st point. |
static BasicNurbsCurve |
createCircularArc(GeomPoint o,
Parameter<Length> r,
GeomVector<Dimensionless> n,
Parameter<Angle> thetaS,
Parameter<Angle> thetaE)
Create a circular arc
NurbsCurve about the specified origin, with the
specified radius and angular start and stop values. |
static BasicNurbsCurve |
createCircularArcO(GeomPoint o,
GeomPoint p1,
GeomPoint p2)
Create a circular arc
NurbsCurve that is approximately centered on the
specified origin point and passes through the two input points. |
static BasicNurbsCurve |
createEllipse(GeomPoint o,
Parameter<Length> a,
Parameter<Length> b,
GeomVector<Dimensionless> n)
Create a full-ellipse
NurbsCurve around the given origin/center with
semi-major axis length a and semi-minor axis length b . |
static BasicNurbsCurve |
createEllipticalArc(GeomPoint o,
Parameter<Length> a,
Parameter<Length> b,
GeomVector<Dimensionless> xhat,
GeomVector<Dimensionless> yhat,
Parameter<Angle> thetaS,
Parameter<Angle> thetaE)
Create an elliptical arc
NurbsCurve about the specified origin, with the
specified semi-major axis length, semi-minor axis length and angular start and stop
values. |
static BasicNurbsCurve |
createLine(GeomPoint p0,
GeomPoint p1)
Create a 1-degree straight line
NurbsCurve that represents the shortest
distance, in Euclidean space between the two input points. |
static BasicNurbsCurve |
createLine(int degree,
GeomPoint p0,
GeomPoint p1)
Create a straight line
NurbsCurve that represents the shortest distance, in
Euclidean space between the two input points with the specified degree. |
static BasicNurbsCurve |
createParabolicArc(GeomPoint p0,
GeomVector<Dimensionless> t0,
GeomPoint p2,
GeomVector<Dimensionless> t2)
Create a planar parabolic arc
NurbsCurve that joins two end points with the
specified tangent vectors at each end point. |
static BasicNurbsCurve |
createPoint(int degree,
GeomPoint p0)
Create a degenerate
NurbsCurve of the specified degree that represents a
point in space. |
static BasicNurbsCurve |
createPoint(int degree,
int numCP,
GeomPoint p0)
Create a degenerate
NurbsCurve of the specified degree that represents a
point in space with the indicated number of co-located control points. |
static BasicNurbsCurve |
createSemiCircle(GeomPoint o,
Parameter<Length> r,
GeomVector<Dimensionless> n)
Create a semi-circle
NurbsCurve with the specified normal vector around the
given origin with radius r . |
static BasicNurbsCurve |
createSuperEllipticalArc(GeomPoint o,
Parameter<Length> a,
Parameter<Length> b,
double m,
double n,
GeomVector<Dimensionless> xhat,
GeomVector<Dimensionless> yhat,
Parameter<Length> tol)
Create the first quadrant of a general super-ellipse
NurbsCurve about the
specified origin, with the specified semi-major and semi-minor axes and exponents. |
static BasicNurbsCurve |
createSuperEllipticalArc(GeomPoint o,
Parameter<Length> a,
Parameter<Length> b,
double m,
double n,
GeomVector<Dimensionless> nhat,
Parameter<Length> tol)
Create the first quadrant of a general super-ellipse
NurbsCurve about the
specified origin, with the specified semi-major and semi-minor axes and exponents. |
static BasicNurbsCurve |
createSuperEllipticalArc(GeomPoint o,
Parameter<Length> a,
Parameter<Length> b,
double n,
GeomVector<Dimensionless> nhat)
Create the first quadrant of a common exponent super-ellipse
NurbsCurve
about the specified origin, with the specified semi-major and semi-minor axes and
exponent. |
static BasicNurbsCurve |
createSuperEllipticalArc(GeomPoint o,
Parameter<Length> a,
Parameter<Length> b,
double n,
GeomVector<Dimensionless> xhat,
GeomVector<Dimensionless> yhat)
Create the first quadrant of a common exponent super-ellipse
NurbsCurve
about the specified origin, with the specified semi-major and semi-minor axes and
exponent. |
static BasicNurbsCurve |
fitPoints(int degree,
PointString<? extends GeomPoint> points)
Create a
NurbsCurve of the specified degree that is fit to, interpolates,
or passes through the specified list of geometry points in the input order. |
static BasicNurbsCurve |
fitPoints(int degree,
PointString<? extends GeomPoint> points,
double[] uk,
KnotVector uKnots)
Create a
NurbsCurve of the specified degree that is fit to, interpolates,
or passes through the specified list of geometry points in the input order. |
static BasicNurbsCurve |
fitPoints(int degree,
PointString<? extends GeomPoint> points,
java.util.List<GeomVector> tangents,
boolean unitFlag,
double tanlen)
Create a
NurbsCurve of the specified degree that is fit to, interpolates,
or passes through the specified list of geometry points constrained to the input
list of tangent vectors at each point in the input order. |
static void |
parameterizationCheck(int size,
double[] uk)
Check the array of parameterization values and reports any problems by throwing
a ParameterException.
|
static double[] |
parameterizeString(PointString<? extends GeomPoint> points)
Turn a string of points into a list of parameter values along a curve through those
points.
|
public static BasicNurbsCurve createPoint(int degree, GeomPoint p0)
NurbsCurve
of the specified degree that represents a
point in space.degree
- The degree of the curve to create.p0
- The location for the degenerate curve. May not be null.public static BasicNurbsCurve createPoint(int degree, int numCP, GeomPoint p0)
NurbsCurve
of the specified degree that represents a
point in space with the indicated number of co-located control points.degree
- The degree of the curve to create.numCP
- The number of control points to use in the degenerate curve.p0
- The location for the degenerate curve. May not be null.public static BasicNurbsCurve createLine(GeomPoint p0, GeomPoint p1)
NurbsCurve
that represents the shortest
distance, in Euclidean space between the two input points.p0
- The start of the line. May not be null.p1
- The end of the line. May not be null.public static BasicNurbsCurve createLine(int degree, GeomPoint p0, GeomPoint p1)
NurbsCurve
that represents the shortest distance, in
Euclidean space between the two input points with the specified degree.degree
- The degree of the NurbsCurve to return.p0
- The start of the line. May not be null.p1
- The end of the line. May not be null.public static BasicNurbsCurve createSemiCircle(GeomPoint o, Parameter<Length> r, GeomVector<Dimensionless> n) throws DimensionException
NurbsCurve
with the specified normal vector around the
given origin with radius r
. The curve returned has a control polygon
which has 4 points and the shape of a rectangle.o
- Origin to create a semi-circle around. May not be null.r
- Radius of the semi-circle May not be null.n
- A unit plane normal vector for the plane containing the circle. If
null
is passed, a default normal vector that points along the
Z axis is used.DimensionException
- if the origin point or normal do not have at least 2
physical dimensions.public static BasicNurbsCurve createCircle(GeomPoint o, Parameter<Length> r, GeomVector<Dimensionless> n) throws DimensionException
NurbsCurve
around the given origin/center with radius
r
. The NurbsCurve returned has a control polygon which has 9 control
points and the shape of a square.o
- Origin or center to create the full-circle around. May not be null.r
- Radius of the full-circle. May not be null.n
- A unit plane normal vector for the plane containing the circle. If
null
is passed, a default normal vector that points along the
Z axis is used.DimensionException
- if the origin point or normal do not have at least 2
physical dimensions.public static BasicNurbsCurve createCircle(GeomPoint p1, GeomPoint p2, GeomPoint p3) throws DimensionException
NurbsCurve
that passes through the input (not
co-linear) points. The curve will be parameterized with 0 at the starting point
with the parameterization increasing toward the last point. The NurbsCurve returned
has a control polygon which has 9 control points and the shape of square.p1
- The 1st of the points that define the circle (must not be colinear with
the other two). May not be null.p2
- The 2nd of the points that define the circle (must not be colinear with
the other two). May not be null.p3
- The 3rd of the points that define the circle (must not be colinear with
the other two). May not be null.DimensionException
- if one of the 3 points does not have at least 2 physical
dimensions.java.lang.IllegalArgumentException
- if the input points are co-linear.public static BasicNurbsCurve createCircleO(GeomPoint o, GeomPoint p1, GeomPoint p2) throws DimensionException
NurbsCurve
that is approximately centered on the
specified origin point and passes through the two input points. The origin point is
used to determine the plane that the circle lies in and is used to approximate the
center of the circle. The true origin/center of the circle is calculated to ensure
that the circle passes through the supplied edge points. The curve is parameterized
such that 0 is at the first point and the parameterization increases toward the 2nd
point. The NurbsCurve returned has a control polygon which has 9 control points and
the shape of square.o
- Approximate origin or center to create the full-circle around. May not be
null.p1
- The 1st of the points that define the circle. May not be null.p2
- The 2nd of the points that define the circle. May not be null.DimensionException
- if the origin or 2 points do not have at least 2
physical dimensions.public static BasicNurbsCurve createEllipse(GeomPoint o, Parameter<Length> a, Parameter<Length> b, GeomVector<Dimensionless> n) throws DimensionException
NurbsCurve
around the given origin/center with
semi-major axis length a
and semi-minor axis length b
.
The NurbsCurve returned has a control polygon which has 9 control points and the
shape of a rectangle.o
- Origin or center to create the full-ellipse around. May not be null.a
- Semi-major axis length. May not be null.b
- Semi-minor axis length. May not be null.n
- A unit plane normal vector for the plane containing the circle. If
null
is passed, a default normal vector that points along the
Z axis is used.DimensionException
- if the origin point or normal do not have at least 2
physical dimensions.public static BasicNurbsCurve createCircularArc(GeomPoint o, Parameter<Length> r, GeomVector<Dimensionless> n, Parameter<Angle> thetaS, Parameter<Angle> thetaE) throws DimensionException
NurbsCurve
about the specified origin, with the
specified radius and angular start and stop values.o
- The origin to create the arc around. May not be null.r
- The radius of the circular arc. May not be null.n
- A unit plane normal vector for the plane containing the circle. If
null
is passed, a default normal vector that points
along the Z axis is used.thetaS
- The start angle of the arc (relative to the X axis).thetaE
- The end angle of the arc (relative to the X axis). If the end angle
is smaller than the start angle, it is increased by increments of
2*PI until it is larger than the start angle.DimensionException
- if the origin point or normal do not have at least 2
physical dimensions.public static BasicNurbsCurve createCircularArc(GeomPoint p1, GeomPoint p2, GeomPoint p3) throws DimensionException
NurbsCurve
that passes through the input (not
co-linear) points. The curve will be parameterized with 0 at the starting point and
1 at the last point.p1
- The 1st of the points that define the arc (must not be colinear with the
other two). May not be null.p2
- The 2nd of the points that define the arc (must not be colinear with the
other two). May not be null.p3
- The 3rd of the points that define the arc (must not be colinear with the
other two). May not be null.DimensionException
- if one of the 3 points does not have at least 2 physical
dimensions.java.lang.IllegalArgumentException
- if the input points are co-linear.public static BasicNurbsCurve createCircularArc(GeomPoint p1, GeomVector t1, GeomPoint p2) throws DimensionException
NurbsCurve
that passes through the input points and
that has the input tangents at the 1st point. The curve will be parameterized with
0 at the starting point and 1 at the last point.p1
- The 1st of the points that define the arc. May not be null.t1
- The tangent vector at p1 (must not point at p2). May not be null.p2
- The 2nd of the points that define the arc. May not be null.DimensionException
- if one of the 3 points does not have at least 2 physical
dimensions.public static BasicNurbsCurve createCircularArcO(GeomPoint o, GeomPoint p1, GeomPoint p2) throws DimensionException
NurbsCurve
that is approximately centered on the
specified origin point and passes through the two input points. The origin point is
used to determine the plane that the circle lies in and is used to approximate the
center of the circle. The true origin/center of the circle is calculated to ensure
that the circle passes through the supplied edge points. The curve is parameterized
such that 0 is at the first point and 1 is at the last point. The NurbsCurve
returned has a control polygon which has 9 control points and the shape of square.o
- Approximate origin or center to create the arc around. May not be null.p1
- The 1st of the points that define the arc. May not be null.p2
- The 2nd of the points that define the arc. May not be null.DimensionException
- if the origin or 2 points do not have at least 2
physical dimensions.public static BasicNurbsCurve createEllipticalArc(GeomPoint o, Parameter<Length> a, Parameter<Length> b, GeomVector<Dimensionless> xhat, GeomVector<Dimensionless> yhat, Parameter<Angle> thetaS, Parameter<Angle> thetaE) throws DimensionException
NurbsCurve
about the specified origin, with the
specified semi-major axis length, semi-minor axis length and angular start and stop
values.o
- The origin to create the arc around. May not be null.a
- The ellipse semi-major axis length (half the ellipse diameter in the
xhat direction). May not be null.b
- The ellipse semi-minor axis length (half the ellipse diameter in the
yhat direction). May not be null.xhat
- A unit vector indicating the "X" or semi-major axis direction in the
plane of the ellipse. This must be orthogonal to yhat. May not be
null.yhat
- A unit vector indicating the "Y" or semi-minor direction in the plane
of the ellipse. This must be orthogonal to xhat. May not be null.thetaS
- The start angle of the arc (relative to the xhat axis). May not be
null.thetaE
- The end angle of the arc (relative to the xhat axis). If the end
angle is smaller than the start angle, it is increased by increments
of 2*PI until it is larger than the start angle. May not be null.DimensionException
- if the origin point or axes do not have at least 2
physical dimensions.public static BasicNurbsCurve createParabolicArc(GeomPoint p0, GeomVector<Dimensionless> t0, GeomPoint p2, GeomVector<Dimensionless> t2) throws DimensionException
NurbsCurve
that joins two end points with the
specified tangent vectors at each end point. If the input tangent vectors are
either parallel or not coplanar, then a straight line between the two end points is
returned. If the intersection of the two input tangent vectors does not fall
between the two input end points, then a straight line between the two end points
is returned.p0
- The starting end of the arc. May not be null.t0
- The tangent vector at the starting end of the arc. May not be null.p2
- The stopping end of the arc. May not be null.t2
- The tangent vector at the stopping end of the arc. May not be null.DimensionException
- if the input points and tangents do not have at least 2
physical dimensions.createBlend(geomss.geom.GeomPoint, geomss.geom.GeomVector, geomss.geom.GeomPoint, geomss.geom.GeomVector, boolean, double)
public static BasicNurbsCurve createSuperEllipticalArc(GeomPoint o, Parameter<Length> a, Parameter<Length> b, double n, GeomVector<Dimensionless> nhat) throws DimensionException
NurbsCurve
about the specified origin, with the specified semi-major and semi-minor axes and
exponent. Other quadrants can be represented by reflection. A common exponent
super-elliptic arc can be described using the following equation:(x/a)^n + (y/b)^n = 1
o
- The origin to create the arc around. May not be null.a
- The super-ellipse semi-major (or minor if b is major) axis. May not be
null.b
- The super-ellipse semi-minor (or major if a is minor) axis. May not be
null.n
- The exponent for the super-ellipse (must be > 0).nhat
- A unit plane normal vector for the plane containing the super-ellipse.
If null
is passed, a default normal vector that points
along the Z axis is used.DimensionException
public static BasicNurbsCurve createSuperEllipticalArc(GeomPoint o, Parameter<Length> a, Parameter<Length> b, double n, GeomVector<Dimensionless> xhat, GeomVector<Dimensionless> yhat) throws DimensionException
NurbsCurve
about the specified origin, with the specified semi-major and semi-minor axes and
exponent. Other quadrants can be represented by reflection. A super-elliptic arc
can be described using the following equation:(x/a)^n + (y/b)^n = 1
o
- The origin to create the arc around. May not be null.a
- The super-ellipse semi-major (or minor if b is major) axis. May not be
null.b
- The super-ellipse semi-minor (or major if a is minor) axis. May not be
null.n
- The exponent for the super-ellipse (must be > 0).xhat
- A unit vector indicating the "X" or semi-major axis direction in the
plane of the super-ellipse. This must be orthogonal to yhat. May not be
null.yhat
- A unit vector indicating the "Y" or semi-minor axis direction in the
plane of the super-ellipse. This must be orthogonal to xhat. May not be
null.DimensionException
public static BasicNurbsCurve createSuperEllipticalArc(GeomPoint o, Parameter<Length> a, Parameter<Length> b, double m, double n, GeomVector<Dimensionless> xhat, GeomVector<Dimensionless> yhat, Parameter<Length> tol) throws DimensionException, java.lang.IllegalArgumentException, SingularMatrixException, ParameterException
NurbsCurve
about the
specified origin, with the specified semi-major and semi-minor axes and exponents.
Other quadrants can be represented by reflection. A general super-elliptic arc can
be described using the following equation:(x/a)^m + (y/b)^n = 1
o
- The origin to create the arc around. May not be null.a
- The super-ellipse semi-major (or minor if b is major) axis. May not be
null.b
- The super-ellipse semi-minor (or major if a is minor) axis. May not be
null.m
- The exponent on the x/a term of the super-ellipse equation (must be >
0).n
- The exponent for the y/b term of the super-ellipse equation (must be >
0).xhat
- A unit vector indicating the "X" or semi-major axis direction in the
plane of the super-ellipse. This must be orthogonal to yhat. May not be
null.yhat
- A unit vector indicating the "Y" or semi-minor axis direction in the
plane of the super-ellipse. This must be orthogonal to xhat. May not be
null.tol
- A geometric tolerance on how accurately the NURBS curve must represent
the true super-ellipse. If m == n, then an exact representation is
returned and "tol" is ignored, otherwise tol may not be null.DimensionException
java.lang.IllegalArgumentException
SingularMatrixException
ParameterException
public static BasicNurbsCurve createSuperEllipticalArc(GeomPoint o, Parameter<Length> a, Parameter<Length> b, double m, double n, GeomVector<Dimensionless> nhat, Parameter<Length> tol) throws DimensionException, java.lang.IllegalArgumentException, SingularMatrixException, ParameterException
NurbsCurve
about the
specified origin, with the specified semi-major and semi-minor axes and exponents.
Other quadrants can be represented by reflection. A general super-elliptic arc can
be described using the following equation:(x/a)^m + (y/b)^n = 1
o
- The origin to create the arc around. May not be null.a
- The super-ellipse semi-major (or minor if b is major) axis. May not be null.b
- The super-ellipse semi-minor (or major if a is minor) axis. May not be null.m
- The exponent on the x/a term of the super-ellipse equation (must be >
0).n
- The exponent for the y/b term of the super-ellipse equation (must be >
0).nhat
- A unit plane normal vector for the plane containing the super-ellipse.
If null
is passed, a default normal vector that points
along the Z axis is used.tol
- A geometric tolerance on how accurately the NURBS curve must represent
the true super-ellipse. If m == n, then an exact representation is
returned and "tol" is ignored, otherwise "tol" may not be null..DimensionException
java.lang.IllegalArgumentException
SingularMatrixException
ParameterException
public static BasicNurbsCurve createBlend(GeomPoint p1, GeomVector t1, GeomPoint p2, GeomVector t2, boolean unitFlag, double tanlen) throws DimensionException
NurbsCurve
that joins or
blends two end points with the specified tangent vectors at each end point. If unit
vectors are supplied, then they will be scaled by the distance between the end
points and the multiplicative factor provided (tanlen).p1
- The starting end of the arc. May not be null.t1
- The tangent vector at the starting end of the arc. May not be null.p2
- The stopping end of the arc. May not be null.t2
- The tangent vector at the stopping end of the arc. May not be null.unitFlag
- A flag indicating that the tangents are all unit vectors if
true
.tanlen
- A multiplicative factor for the tangent (must be greater than 0 or
the function aborts). Used only if unitFlat == true
.
Applied to the distance between end points to scale the tangent
vectors.DimensionException
- if the input points and tangents do not have at least 2
physical dimensions.createParabolicArc(geomss.geom.GeomPoint, geomss.geom.GeomVector<javax.measure.quantity.Dimensionless>, geomss.geom.GeomPoint, geomss.geom.GeomVector<javax.measure.quantity.Dimensionless>)
public static BasicNurbsCurve fitPoints(int degree, PointString<? extends GeomPoint> points) throws java.lang.IllegalArgumentException, SingularMatrixException, ParameterException
NurbsCurve
of the specified degree that is fit to, interpolates,
or passes through the specified list of geometry points in the input order. This is
a global interpolation of the points, meaning that if one of the input points is
moved, it will affect the entire curve, not just the local portion near the point.degree
- The degree of the NURBS curve to create (must be > 0 and ≤ the
number of data points).points
- The string of GeomPoint objects to pass the curve through. May not be
null.java.lang.IllegalArgumentException
- if the degree is ≤ 0 or ≥ the number of
points input.SingularMatrixException
- if the decomposed matrix is singular.ParameterException
approxPoints(int, int, geomss.geom.PointString<? extends geomss.geom.GeomPoint>)
public static BasicNurbsCurve fitPoints(int degree, PointString<? extends GeomPoint> points, double[] uk, KnotVector uKnots) throws java.lang.IllegalArgumentException, SingularMatrixException
NurbsCurve
of the specified degree that is fit to, interpolates,
or passes through the specified list of geometry points in the input order. This is
a global interpolation of the points, meaning that if one of the input points is
moved, it will affect the entire curve, not just the local portion near the point.degree
- The degree of the NURBS curve to create (must be > 0 and ≤ the
number of data points).points
- The string of GeomPoint objects to pass the curve through. May not be
null.uk
- The parameterization array to use for each of the input points. Must
be monotonically increasing and must include 0 and 1. May not be
null.uKnots
- The knot vector to use with the output curve. May not be null.java.lang.IllegalArgumentException
- if the degree is ≤ 0 or ≥ the number of
points input or the parameterization array is invalid.SingularMatrixException
- if the decomposed matrix is singular.approxPoints(int, int, geomss.geom.PointString, double[],
geomss.geom.nurbs.KnotVector)
,
parameterizeString(geomss.geom.PointString)
,
buildInterpKnotVector(double[], int, int)
public static BasicNurbsCurve fitPoints(int degree, PointString<? extends GeomPoint> points, java.util.List<GeomVector> tangents, boolean unitFlag, double tanlen) throws java.lang.IllegalArgumentException, SingularMatrixException, ParameterException
NurbsCurve
of the specified degree that is fit to, interpolates,
or passes through the specified list of geometry points constrained to the input
list of tangent vectors at each point in the input order. This is a global
interpolation of the points, meaning that if one of the input points is moved, it
will affect the entire curve, not just the local portion near the point.degree
- The degree of the NURBS curve to create (must be > 0 and < the
number of data points).points
- The string of Geom Point objects to pass the curve through. May not
be null.tangents
- A list of tangent vectors, one for each point in "points". May not
be null.unitFlag
- A flag indicating that the derivatives are all unit vectors if
true
.tanlen
- A multiplicative factor for the tangent (must be greater than 0 or
the function aborts and should be near 1.0). Used only if
unitFlag == true
.java.lang.IllegalArgumentException
- if the degree is ≤ 0 or &ge: the number of
points input.SingularMatrixException
- if the decomposed matrix is singular.ParameterException
approxPoints(int, int, geomss.geom.PointString<? extends geomss.geom.GeomPoint>)
public static double[] parameterizeString(PointString<? extends GeomPoint> points)
points
- A string of points to be parameterized for use in a curve. May not be
null.public static void parameterizationCheck(int size, double[] uk) throws ParameterException
size
- The number of parameters in the array.uk
- The array of parameterization values to check.ParameterException
- if there is a problem with the parameterization array.public static KnotVector buildInterpKnotVector(double[] uk, int numPoints, int p)
uk
- The parameter values for each point in the curve. May not be null.numPoints
- The total number of points in the curve (and parameter array).p
- The degree of the NURBS curve.public static BasicNurbsCurve approxPoints(int degree, int nCP, PointString<? extends GeomPoint> points) throws java.lang.IllegalArgumentException, SingularMatrixException, ParameterException
NurbsCurve
of the specified degree that approximates, in a least
squared error sense, the specified list of geometry points in the input order. This
is a global approximation of the points, meaning that if one of the input points is
moved, it will affect the entire curve, not just the local portion near the point.degree
- The degree of the NURBS curve to create (must be > 0 and < the
number of data points).nCP
- The number of control points in the new curve (must be > 1 and
< the number of data points).points
- The string of GeomPoint objects to be approximated by the curve. May
not be null.SingularMatrixException
- if the decomposed matrix is singular.java.lang.IllegalArgumentException
- if the any of the inputs is invalid.ParameterException
fitPoints(int, geomss.geom.PointString<? extends geomss.geom.GeomPoint>)