gen_contour_nurbs_xld
— Transform a NURBS curve into an XLD contour.
gen_contour_nurbs_xld
generates an XLD Contour
that
approximates a
NURBS curve (non-uniform rational B-Spline curve). The NURBS curve is
specified by its Degree
, a control polygon (via Rows
and
Cols
), a Weights
vector and a Knots
vector.
The Degree
of the curve determines the grade of differentiability of
the curve. The curve lies within the convex hull of its control
polygon (Rows
,Cols
). The weights in Weights
determine how much the curve is
attracted by the individual control points (Rows
,Cols
).
A Weights
vector with equal weights for all
control points is generated if 'auto' is chosen.
The Knots
vector describes the domain of the curve.
Typically, this parameter can be set to 'auto' .
The accuracy of the generated Contour
depends on the two parameters
MaxDistance
and MaxError
. MaxDistance
limits the
maximum distance of two subsequent Contour
points. The maximum
distance between the generated Contour
and the actual NURBS curve
is limited to MaxError
. By default the approximation must fulfill
both constraints, but it is possible to set one of these parameters to
'omit' . The lower MaxError
and MaxDistance
are chosen
the better is the approximation of the curve. Note that all Contour
points lie exactly on the curve (except for numerical inaccuracies).
Definition
A NURBS curve of degree is given by
The basis functions are defined by
Thus, each NURBS curve is determined by its Degree
,
its control Polygon
(Rows
and
Cols
), its weight vector
(Weights
), and its knot vector
(Knots
).
The grade of differentiability of the curve is set via the degree . At least control points are required to form a valid curve. The knot vector describes the domain of the curve. Its length must be and its entries must be monotonically increasing. Every entry stands for a knot between the curve segments and . Each curve segment lies within the convex hull of the control points . For every curve segment of length zero, the differentiability at knot decreases. The number of occurrences of each knot in the knot vector is called multiplicity. The maximum multiplicity of one knot is . Only the start and the end point's multiplicity can be (which in fact is the case for most curves, because in this case start and end point of the curve correspond to the first respectively last point of the control polygon). If start and/or end point do not have full multiplicity, the domain of the curve is restricted to . The weights determine the influence of the individual control points on the curve.
Closed Curves: If start and end point are equal
()
and Knots
is set to 'auto' , the curve is closed
automatically such that all knots feature multiplicity one.
Note that in this case the length of Weights
is required to be
.
Contour
(output_object) xld_cont →
object
The contour that approximates the NURBS curve.
Rows
(input_control) coordinates.y-array →
(real)
Row coordinates of the control polygon.
Number of elements: Rows == Cols && Rows >= Degree + 1
Cols
(input_control) coordinates.x-array →
(real)
Column coordinates of the control polygon.
Number of elements: Cols == Rows && Cols >= Degree + 1
Knots
(input_control) string(-array) →
(string / real)
The knot vector .
Default value: 'auto'
Suggested values: 'auto'
Weights
(input_control) string(-array) →
(string / real)
The weight vector .
Number of elements: Weights == Rows
Default value: 'auto'
Suggested values: 'auto'
Restriction: Weights > 0.0
Degree
(input_control) integer →
(integer)
The degree of the NURBS curve.
Default value: 3
Suggested values: 2, 3, 4, 5
Restriction: Degree >= 2
MaxError
(input_control) real →
(real / string)
Maximum distance between the NURBS curve and its approximation.
Default value: 1.0
Suggested values: 'omit' , 1.0, 2.0, 3.0, 4.0, 5.0
Restriction: MaxError > 0.0
MaxDistance
(input_control) real →
(real / string)
Maximum distance between two subsequent
Contour
points.
Default value: 5.0
Suggested values: 'omit' , 1.0, 2.0, 3.0, 4.0, 5.0
Restriction: MaxDistance > 0.0
* use a polygon XLD contour as control polygon and approximate * the NURBS curve as contour get_contour_xld(Polygon, Row, Col) gen_contour_nurbs_xld(NURBSContour, Row, Col, 'auto', 'auto', 3, 1.0, 10.0)
L. Piegl, W. Tiller: ”The NURBS Book”, 2nd Edition, Springer, 1997.
Foundation