Approximating Curve by A Single Segment of B-Splin PDF
Approximating Curve by A Single Segment of B-Splin PDF
Faculty of Mechanical Engineering and Aeronautics, Rzeszow University of Technology, Rzeszów, Poland
Abstract
The paper presents the method of approximating curves with a single segment of the B-Spline and Bézier curves. The
method for determining a single curve segment using the optimization methods in the CATIA environment is shown.
The algorithms of simulated annealing and design of experiment are used for optimization. For the same purpose, a
new original procedure for determining the distance between the given curves using explicit parameters in the CATIA
environment was also used. This approximation of the cyclic curves results in the curve oscillation as shown in the
examples. The results show that the approximation method with Bézier curve using control points as “free” points can
be applied to obtain the best results of approximation.
Keywords
Bézier curve, curve approximation, design of experiment, algorithms of simulated annealing
1. Introduction
Among all curves implemented in CAD environment, the Bézier simulated annealing algorithm, design of experiment, and the
curve is characterized by the best quality of division, hence it “mixed” method. The optimization consists of such matching of
is often used in CAD systems and in engineering applications Bézier curve that the distance between the curves is as small
[1]. This curve is recommended for CAD modeling when the as possible. The optimization uses the explicit procedure for
curve is divided into segments [2]. The sum of the segments is determining the distance of curves in the CATIA environment
geometrically equivalent to the curve before the division. This proposed by the authors because the procedure of curves
is especially important in industrial practice [3]. It happens that distance analysis implemented in the CAD environment can not
geometry is imported from other CAD systems than currently be used due to its implicit nature.
used or is created as a different type of curve. Therefore, A single curve segment in the CAD environment is most often
some curves should be replaced with Bézier curves, which are a geometric representation of the third-degree polynomials.
used for further modeling. The indication of the accuracy of Depending on the limitations, it assumes the mathematical form
the approximation is the distance between the curves, which of the Hermite curve or the Bézier curve (Figure 1) [1–3]. In both
should be as small as possible. It should be mentioned that cases, the four conditions are required to describe the curve
certain curves can be approximated by Bézier curves with segment. For the Hermite curve, there are two points (begin and
some error (e.g., circle arc) [4–7]. The methods of automatic end point) and two vectors tangent at the starting and ending
curve conversion implemented in the CAD environment do points. For the Bézier curve, there are four control points, where
not always give a satisfactory result. This is the result of the P P define the beginning and the end of the segment and the
1 and 2
assumption of maintaining the directions of tangent vectors sections P P and P P determine the directions of tangents at the
1 2 3 4
at the ends of the approximated curve [2]. The user does not beginning and the end of the segment.
have access to the mathematical model of the curve in the In the CATIA environment, in the generative shape design (GSD)
CAD environment, so another solution should be used [8]. module, there is available a spline in form similar to Hermite,
The article presents the methodology for approximating where a starting and ending point, senses and magnitudes of
the curve by the Bézier curve using optimization methods the tangential vectors at these points and additionally sides and
implemented in the CATIA environment, such as the radii of curvature can be specified (Figure 2a).
*
Corresponding author: Mariusz Sobolak
E-mail: msobolak@prz.edu.pl
120
Sobolak et al.: Method of approximating curves
Figure 2. Single curve segments: (a) spline in the GSD module and (b) Bézier curve in the free-style module.
121
Advances in Manufacturing Science and Technology
(that can be used by the user as a parameter). Therefore, (point on the approximated curve, point on the approximating
it is necessary to prepare a new, specific measurement curve). The relevant pairs of points lying in the same planes
procedure where the maximum curves distance can be are indicated in brackets. The task is to minimize the distance;
parameterized. The procedure requires repeating operations, hence, it is needed to choose the largest value from among
therefore a programming language can be used, but it is not specified parameters l1÷l9. For this purpose, a distance
shown here. Distances measurement should be discretized. parameter lmax is created with assigned formula (Figure 9):
The points, which the distances are measured, are created max(l1/1mm, l 2 /1mm, l 3 /1mm, l 4 /1mm, l 5 /1mm, l 6 /1mm, l 7 /1mm, l 8 /1mm, l 9 / 1mm) *1mm
with the Points and Planes Repetition command (Figure 6). As the max function is in operation only for real-type
In the considered example, the division into 10 segments was parameters, the values of parameters l1 ÷l9 are divided by 1
adopted, which requires to use 9 points. If the programming mm, and finally the maximum value is multiplied by 1 mm to
language is used, the number of points can be much greater. give back the length unit.
At each point dividing the approximated curve, a normal Now, by changing the values of parameters t1 and t2
plane to this curve must be additionally created (the active (magnitudes of tangent vectors), it is possible to change the
option: Create normal planes also). The measurement of the maximum distance between curves. This distance should
distance from the approximating curve is realized in these be minimized. This can be realized using the optimization
planes. command in the Product Engineering Optimizer module
Afterwards, the points that are created as a result of (Figure 10).
intersection of the spline with the created planes should be The minimization has to be selected as the type of optimization,
determined. If the option Create in a new body was selected the lmax variable as the optimized parameter, t1 and t2 as
in the previous command, points and planes were created parameters influencing the value lmax. For parameters t1
in the new geometrical set (Figure 7). That allows selecting and t2, their range can be specified. The simulated annealing
all planes in the Intersection command by choosing the
geometrical set where they are located (Figure 8).
The distances between points in the individual planes should
be described by variables. For this purpose, the distance
parameters (length) are created from l1 to l9, which the
distance measurement formulas are given as: distance
122
Sobolak et al.: Method of approximating curves
parameter values for t1 and t2. This is the first approximation type should be created. Then at the beginning and the end of the
but not the most appropriate that can be obtained. At this stage, approximated curve, the tangent segment with the appropriate
it is possible to limit the change range of t1 and t2 and then lengths d and d should be modeled (Figure 12). The control
1 2
perform the optimization again. points P and P are the endpoints of these segments.
2 3
The following results were obtained for the approximated Having the points P P P P it is possible to create a Bézier
1, 2, 3, 4
arc: t1= 1.168367213, t2= 1.168367209. The values are very curve segment (3D Curve command in the FreeStyle module).
123
Advances in Manufacturing Science and Technology
The type of creation by the control points should be chosen the end of the curve. It is assumed that the coordinates of
and appropriate points should be selected (Figure 13). points P and P are the variables.
2 3
The curve approximation is realized in a similar way to that In the CATIA environment, the variables x2, y2, x3, y3 are
shown earlier for the B-Spline curve. The variable parameters created and they are corresponding to the coordinates of
in this case are the lengths of the tangent segments d and d .
1 2
the points P and P (Figure 15). The values of variables x2,
2 3
Figure 14 shows the comparison of a circle fragment with an y2, x3, y3 are initially assumed. Control points P and P are
2 3
approximating Bézier curve. In this case, the oscillation of the created on the plane where the section of the approximated
approximation curve also occurred. circle was located (Figure 16).
The Design of Experiment (DOE) method can be used to Having the points P P P P the Bézier curve segment is
1, 2, 3, 4
determine the curve approximation by a spline. This method created similarly as in the previous example (3D Curve
is beneficial if there are more variables affecting the result. command in the FreeStyle module). The type of creation
The method will be shown on the example of approximation by the control points should be chosen and the appropriate
of a circle segment by the Bézier curve. This time the points points should be selected.
are not fixed with tangent straight lines at the beginning and After the Bézier curve was created, the matching procedure
124
Sobolak et al.: Method of approximating curves
is identical to the B-Spline curve up to the optimization stage. Product Engineering Optimizer module) should be used.
A set of planes which intersect curves is created. Variables The input parameters are the values of coordinates x2, y2,
corresponding to the distance of points in individual planes x3, y3 (Figure 17). For each coordinate, the minimum value
and a formula determining the maximum distance of lmax (Inf. Range), the maximum (Sup. Range), and the number
from among are defined. of levels (Nb of Levels) are declared. The number of levels
To determine the parameters values x2, y2, x3, y3, the design defines the discretization step. The lmax distance is the output
method using the DOE experiment (Design of Experiment, parameter. After starting the experiment (Run DOE), a table
of all possible combinations of dimensions is created. The
obtained table in Excel format can be sorted according to the
lmax column. Then the values of the parameters x2, y2, x3,
y3 for the smallest lmax can be read. Because many solutions
are created (in the shown example for 21 levels for each
variable x2, y2, x3, y3 194481 combinations are generated), it
Figure 15. Variables corresponding to coordinates of control points is strongly advised to assume not to many levels in this step.
P2 and P3, After determining the first approximation, the initial data can
be modified by narrowing the search.
The results x2 = 55.29, y2 = 99.92, x3 = 99.92, y3 = 55.29
were obtained. This means that the points P and P do not lie
2 3
on the lines that are tangent to the circle arc at the beginning
and the end. The Bézier curve in this case approximates the
circle arc with a smaller error, but the number of oscillations
increased (Figure 18).
Figure 16. Creating a control point. As examples of approximation the involute and fillet curve
were presented. These curves can be found in the flank
profile of gears (Figure 19).
Involute and fillet curve were created by parametric equations
directly in the CAD environment [9, 10]. Modeling with
parametric equations in CATIA is not the subject of this article,
so it is not presented.
Figure 17. Design of Experiment (DOE). Figure 18. Comparison of the circle arc with the approximating
Bézier curve.
125
Advances in Manufacturing Science and Technology
The involute was approximated by a single spline segment. The comparison shows that the maximum distance is ca.
The values of tangent vectors were determined: at the 0.005 mm, so in the industrial practice it is not satisfactory.
beginning of involute at the basic diameter t1 = 0.386, on Oscillations of the spline are visible. In order to increase
the addendum diameter: t2 = 1.568 (Figure 20). The distance accuracy, the involute should be approximated by several
analysis of the involute and approximated curve was executed segments of the spline.
(Figure 21).
3.2. An example of fillet curve approximation (Bézier
curve)
The fillet curve was modeled in the CATIA environment using
the parametric equation of the extended involute in the plane x,y.
To approximate fillet curve with the Bézier curve, the variables
x2, y2, x3, y3 corresponding to the coordinates of the control
points P and P were created and the initial values were
2 3
126
Sobolak et al.: Method of approximating curves
Figure 26. A fragment of the optimization window. Figure 28. The preparation of the experiment.
127
Advances in Manufacturing Science and Technology
References
128