Graphically defined irregular curves are
found in various engineering problems. For example, an undulating curve drawn
arbitrarily by an architect can become the basis of a project (Fig. 1). For the
practical application of such a curve, it is replaced (with a certain degree of
accuracy) by a regular curve.
Fig. 1.
Modern airport
In modern CAD
systems, the irregular curve is approximated by the NURBS curve, which has
become a standard tool for computer modeling [1]. This approach may not always
satisfy the designer. The NURBS curve, despite its universality, does not take
into account certain local geometric conditions imposed on the simulated line
(tangents at the nodal points, radii of curvature at the end points, etc.). For
example, using Fusion 360 CAD tools, it is impossible to construct a curve which
smoothly mates two given circles at the indicated mating. Meanwhile, for a set
of parametrized cubic curves, this problem can have four solutions (see
paragraph 5).
Another approach
is based on the use of a composite curve passing through the characteristic
points of the simulated line and satisfying the specified smoothness
conditions. Bezier [2, 3] or Hermite [4] cubic curves are most often used as
segments of a composite curve. The choice of cubic curves is explained by the
simplicity and clarity of their mathematical description combined with good
"flexibility", sufficient for many practical applications. In
particular, when using cubic Bezier segments with unit weight coefficients, the
error in modeling the physical spline does not exceed 2% (see paragraph 6).
The main problem
in the formation of a composite curve is to ensure a given degree of
smoothness. Let us assume that the simulated irregular curve has a degree of
smoothness
G2(continuous change in curvature). The riverbed,
the trajectory of the aircraft, a flexible metal ruler, Euler elastics [5], and
other natural curves have a smoothness of at least
G2. Even
the movement of a pencil on paper, as a body of non-zero mass, obeys Newton's
second law, according to which a jump in the acceleration vector is possible
only with an abrupt change in the driving force. In this case, they say that
"the architect’s hand trembled”.
Segments can be smoothly
joined in various ways. In [3], to ensure a given degree of smoothness, the
authors proposed to change the order of the connected segments, which leads to
complication of the mathematical model. In [4], a simplified approach is used,
when at the junction point the vectors of the first derivatives are assumed to
coincide not only in direction, but also in modulus. At the same time, one
degree of freedom is lost.
The classical
approach proposed by P. Bezier is based on connecting segments of the same order
[2, p. 169]. In a monograph by A Foks [6, p. 152], a vector condition for a
G2-smooth
connection of segments of a spatial cubic Bezier curve is obtained. We show
that for the plane case this condition is reduced to the solution of an ordinary
quadratic equation (see paragraph 3).
The problem of
forming a planar cubic Bezier segment with predetermined tangents and radii of
curvature at both ends is also worth investigating and solving. In [6, p. 153]
it is noted that in order to construct such a segment, it is necessary to solve
an algebraic equation of the fourth degree. In this article we show that there
is no need to solve the equation of the fourth degree, since the task is
reduced to finding the intersection points of two parabolas (see paragraph 5).
Scientific novelty.
A
graphoanalytic algorithm has been developed for the construction of a flat composite
G2-smooth (everywhere twice differentiable) cubic Bezier
curve passing through specified reference points and touching the specified
straight lines at these points. A distinctive feature of the algorithm is to
take into account the direction of tangent vectors and radii of curvature at
the reference and end points of the curve being constructed. A software module
has been developed to allow for interactive control of the shape of a composite
curve (while maintaining the second order of smoothness at the junction
points).
The work is
beneficial
to the scientific community
since
the
theory and practice of forming composite parametrized curves used in technical
design since the mid-1960s is not sufficiently reflected in Russian scientific
publications and textbooks on engineering and computer graphics [7, 8, 9].
Practical
significance.
The graphoanalytic algorithm proposed in the article
allows for the construction of a
G2-smooth composite cubic
Bezier curve with specified tangents at the reference points, and specified
tangents and specified radii of curvature at the end points. Such curves are
used to model a variety of geometric objects and physical processes, in
particular, to approximate irregular (graphically defined) curved lines.
An irregular curve
passing through the reference points 0, 1, 2,...,
n
is fixed on the
plane. Tangents
τ0,
τ1,
τ2,…,
τn
are
marked at the reference points. At the end points 0,
n, the curvature
K0,
Kn
is given. We need to construct a
G2-smooth
approximating function which passes through these points, touches these lines, and
has a particular curvature at the end points. The permissible approximation
error is determined by the constructor; as a rule, it should not exceed 1...2%.
We shall compose
the desired curve from segments of cubic curves in the Bezier shape. Any
segment with the number
i=
1, 2, 3,
…,
n
is completely
defined by its characteristic polyline: the starting point
i
-1, the
ending point
I,
and the control points
Qi,
Pi.
For example, the first segment 0-1 is described by parametric Bezier equations:
,
|
(1)
|
where
Q1
(xQ1,
yQ1),
P1
(xP1,
yP1)
are the control points, and points 0(x0,
y0),
1(x1,
y1) are the boundaries of the Bezier
segment. The control points
Q1,
P1
are
incident to the tangents
τ0,
τ1.
The
parameter
t
varies in the range
t
[0, 1].
The auxiliary Cartesian coordinate system
xy
on the drawing plane can be
specified arbitrarily. The position of the control points is determined from
the condition of continuity of curvature changes at the interface points of
neighboring segments, as well as from the condition of providing a
predetermined curvature at the boundary points 0,
n.
Solution.
Let
us fix the shape of a segment. Fixation is provided by specifying the characteristic
polyline. The number of the fixed segment and its characteristic polyline is
set by the constructor. Find the left and right segments smoothly connected to
a fixed segment. On the left and right, attach new segments to the resulting
segments, each time providing a condition of continuity of curvature at the
points of contact. At the same time, we must repeatedly solve two local
problems.
Local Problem 1.
Find
the control points of a planar cubic Bezier segment 1-2 smoothly connected to a
fixed cubic Bezier segment 0-1.
Segments 0-1 and 1-2 are coplanar. At the
junction point 1, both segments must have a common tangent
τ1
and a
common radius of curvature. In addition, the segment 1-2 to be constructed must
touch at its endpoint 2 a predetermined straight line
τ2.
The main difficulty
is ensuring the continuity of curvature at the junction of segments. In case of
parametrized cubic curves, the solution is reduced to finding the roots of a
quadratic equation (see paragraph 3).
We show that the
local problem 1 has ∞1
solutions. The parametric equations of
the cubic Bezier segment contain eight scalar coefficients. Therefore, the
segment has eight degrees of freedom. The coordinates of the segment boundary
points are fixed. The constructed segment has 4 degrees of freedom. The control
points must be incident to the specified tangent. This requirement takes away
two more degrees of freedom from the desired segment. The two remaining degrees
of freedom allow the constructor to specify the radii of curvature at the start
and end points of the segment. But in the condition of problem 1, the curvature
is fixed only at the butt point 1, which absorbs only one degree of freedom.
Consequently, the segment being constructed retains one degree of freedom.
Thus, there are ∞1
Bezier segments satisfying the condition of
problem 1, which allows for the shape of the segment to be controlled.
Local Problem 2.
Find
the control points of a planar cubic Bezier segment with given tangents and
radii of curvature at its end points.
The problem can have 0, 2, or 4 solutions
(see paragraph 5). If the signs of curvature are fixed at the end points, then
the problem cannot have more than one solution.
Construction of a
G2-smooth
composite curve passing through these points and touching the given straight
lines at these points begins with the fixation of a segment. We shall assume
that the user has fixed the first segment 0-1 by presenting it as a
parameterized curve
r(1)
(t). Here and further, the
superscript in parentheses denotes the segment number. The second segment 1-2 must
be attached to the first segment 0-1, ensuring that the curvature of the
connected segments is equal at the butt point 1 and contact with the given straight
lines
τ1,
τ2
at
points 1, 2.
The curvature
K
of a parametrically given curve
r
(t) is determined by the
expression
,
|
(2)
|
where
B
is the unit vector of the binormal. If a plane curve is considered,
then vector
B
is located perpendicular to the plane of the drawing.
It follows from
(2) that the condition of equality of curvature of segments
r(1)
(t)
and
r(2)
(t) at the junction point 1 has the form
.
|
(3)
|
We
shall write the first derivatives as
,
|
(4)
|
where
T1
is the general tangent vector, and the magnitudes
are the modules of the first derivatives
at the junction point 1 (the subscript hereafter denotes the point number).
Substituting expressions (4) into (3), we obtain the smoothness condition:
|
(5)
|
Condition
(5) will be met if
.
|
|
But
condition (5) will also be fulfilled if any vector collinear to vector
T1
is added to the vector
, for example, vector
where
μ
1
is an
arbitrary scalar [6, p. 150]. We obtain the smoothness condition
,
|
(6)
|
valid
for any value of
μ1
(both
positive and negative). The variable parameter
μ1
gives
an additional degree of freedom in the system of constructing a
G2-smooth
curve.
By writing the
equation of segment 0-1 in the Ferguson form
and
differentiating twice, we obtain an expression for calculating the second
derivative at the end of the first segment (at
t
=1):
,
|
(7)
|
where
are derivatives of the first segment at
its boundary points 0, 1.
Similarly,
by writing the equation of the second segment 1-2 as
and
differentiating twice, we obtain an expression for calculating the second
derivative at the beginning of the second segment (at
t
=0):
,
|
(8)
|
where
are vector derivatives of the second
segment at boundary points 1, 2.
Substituting
expressions (7), (8) into (6), we obtain a condition for a smooth connection of
segments 0-1 and 1-2:
,
|
(9)
|
where
the designation
(the ratio of the
modules of vector derivatives 1
at
jointing point) is introduced.
For a smooth
connection of segments, it is not necessary to ensure the continuity of changes
in the modules of derivatives
[6, p. 165]. The
parameter
λ1
can
take any positive values.
To write the
smoothness condition (9) in the Bezier form, we take into account that the
control points
Q1,
P1
of segment 0-1 and
the vector derivatives
at the end points
of this segment are connected by Bezier relations (Fig. 2):
,
|
(10)
|
where
q1,
p1
are vectors indicating the position
of control points
Q1,
P1. Similarly, the
control points
Q2,
P2
of the second segment
and the derivatives
at the end points
of this segment are related by the relations:
,
|
(11)
|
where
q2,
p2
are vectors indicating the position
of the control points
Q2,
P2.
Fig. 2. Connecting
Bezier segments
From
(10) and (11) it follows:
.
|
(12)
|
Substituting
(12) into (9), we obtain a smoothness condition in which there is no vector
r2
indicating the position of the endpoint of the second segment, since the
terms involving this vector are reduced to:
.
|
(13)
|
According
to (12), the control vectors
p1
and
q2
are
interrelated:
.
|
(14)
|
Substituting
(14) into (13) (excluding vector
q2), we obtain a condition
for a smooth connection of segments 0-1 and 1-2 in the Bezier form:
.
|
(15)
|
Here
r1
is a vector indicating the position of the abutting point
1,
q1
and
p1
are vectors indicating the position
of the control points
Q1,
P1
of the first
(fixed by the user) segment 0-1,
p2
is a vector indicating
the position of the control point
P2
of the second (constructed)
segment 1-2 (see Fig. 2). In condition (15) it is not required to specify
either the position of the starting point 0 of the first segment or the
position of the end point 2 of the second segment.
Thus, if the
vector
p2
indicating the position of the control point
P2
of the second segment satisfies condition (15), then, regardless of the
position of points 0 and 2, segments 0-1 and 1-2 will have the same curvature
at the junction point (with fixed vectors
r1,
q1,
p1
and arbitrarily specified values of parameters
λ1
and
μ1).
The
position of the control point
Q2
(vector
q2),
according to the relation (14), functionally depends only on
λ1
(with
fixed vectors
r1
and
p1).
Consider condition
(15) as a parametrically defined function describing the motion of the control
point
P2
on the drawing plane (depending on the parameters
λ1
and
μ1).
Note
that for a fixed parameter
μ1,
equation (15)
describes a parabola along which point
P2
moves. For
different values of
μ1,
we
obtain a family of parabolas. Any point
P2
of any parabola
satisfies the smoothness condition (15).
According to the
condition of the problem, we must find a point
P2
incident to
a predetermined tangent
τ 2
(see
Fig. 2). The position of the point
P2
running along the parabola
(15) is determined (with fixed
μ1
and fixed vectors
r1, q1, p1) by the value of the parameter
λ1.
Therefore, it is necessary to find a value
λ1
at
which the point
P2
falls on the tangent
τ2.
In
other words, we must find the intersection points of the line
τ2
and
the parabola (15).
By decomposing the
vector equation (15) along the
x, y
coordinate axes and assigning an arbitrary
value to the parameter
μ1,
we
obtain the parametric equation of a parabola, where
λ1
plays
the role of an independent parameter:
|
(16)
|
Here
(x1,
y1), (xQ1,
yQ1), (xP1,
yP1)
are the coordinates of the junction point 1 and the control points
Q1,
P1
of the fixed segment 0-1. When changing the parameter
μ1,
we
obtain a family of parabolas.
The equation of
the tangent
τ2
passing through point 2(x2,
y2) and
inclined to the
x
axis at an angle
δ2
has
the form:
.
|
|
The
control point
P2
of the constructed segment 1-2 must be
incident to the case
τ2,
therefore, the coordinates
xP2,
yP2
of the point
P2
must satisfy the equation
.
|
(17)
|
Fixing
the parameter
μ1
in
equation (16) (selecting one parabola from the family of parabolas) and
substituting (16) into (17), after algebraic transformations we obtain a
quadratic equation with respect to
λ1:
|
(18)
|
where:
|
(19)
|
The
value of
λ1
found
from (18) ensures that the smoothness condition (15) is fulfilled and that the
point
P2
belongs to the previously given tangent
τ2.
In contrast to the
generalized smoothness condition (15), in which there is no information about the
endpoint 2 of the constructed segment 1-2, nor about the tangent at point 2,
all boundary conditions are included in equation (18). Therefore, the value of
the parameter λ1, found from equation (18), allows us to
calculate, according to (16), the coordinates of the control point
P2
τ2,
which ensures
smooth conjugation of segments. The coordinates of the other control point
Q2
τ1
of the segment being
constructed are calculated using scalar formulas
|
(20)
|
equivalent
to the vector equation (14).
In equation (18)
there are two functionally related variables
λ1
and
μ1.
As
noted earlier, the parameter
μ1
can be set
arbitrarily. Then from (18) we find the value of parameter
λ1
as a
function of parameter
μ1:
,
|
(21)
|
where
The coefficients
α1,
β1
are
calculated according to (19).
But it is possible
to use a different approach: take the value
λ1
as an
independent variable, and assume the parameter
μ1
to be
functionally dependent on
λ1.
Then from (21)
we obtain:
.
|
(22)
|
Obviously,
equations (21) and (22) are equivalent. Arbitrarily setting the parameter
μ1,
we
calculate, according to (21), the value of the parameter
λ1;
and vice versa, arbitrarily
setting the parameter
λ1,
we
calculate, according to (22), the value of the parameter
μ1.
Substituting
the pair of
μ1,
λ1
into
equations (16) and (20), we calculate the coordinates of the control points
μ1,
λ1
of the
constructed segment 1-2. Local problem 1 has been solved.
An irregular
(graphically defined) curve is presented on the computer screen. Points 0, 1,
2, ... are marked on the curve and tangents are fixed at these points
τ0,
τ1,
τ2,
… We
must find a composite cubic Bezier curve passing through these points and touching
these lines. Following Bezier [2, p. 106], we shall call this an approximating
curve, despite the fact that it must pass strictly through the specified
points.
Step 1.
By moving the control points
Q1,
P1
along the tangents
τ0,
τ1
and
drawing the Bezier segment (1) for each combination {Q1,
P1},
we achieve a satisfactory coincidence of the Bezier segment with the section
0-1 of the graphically defined curve.
Step 2.
We arbitrarily set the parameter
λ1,
thereby fixing the control point
Q2
on the case
τ1
(see
Fig. 2):
.
|
|
Using
expressions (20), we calculate the coordinates of the control point
Q2:
Note to Step 2.
Instead of
specifying the numeric value of the parameter
λ1,
the
constructor can arbitrarily mark the control point
Q2
on the
tangent
τ1,
and
then calculate
λ1.
Step 3.
According to (22), we calculate
parameter
μ1:
.
|
|
Step 4.
We calculate the coordinates of
the control point
P2
τ2,
the position of which, according to (16), functionally depends on
λ1
and
μ1:
Step 5.
We calculate a two-dimensional
array of points of the Bezier segment 1-2, setting the values of the parameter
t
in the range
t
[0, 1]:
Result:
a Bezier segment passing through
points 1, 2 and touching the lines
τ1,
τ2
at
these points is obtained. At the junction point 1, the resulting segment has
the same radius of curvature as segment 0-1
If satisfactory
accuracy of the approximation of section 1-2 is achieved, we proceed to modeling
the next section. If the accuracy of the approximation does not satisfy the
constructor, we change the position of the point
Q2
τ1
and repeat Steps
2...5. The dialogue continues until the specified accuracy of the approximation
is reached in section 1-2.
Note.
By specifying
different positions of the control point
Q2
τ1,
we obtain
∞1
Bezier segments satisfying the condition of the local
problem 1. This is due to the presence of the variable parameter
μ1
in the
smoothness condition (15). Neglecting this parameter leads to a loss of
variability: for
μ1=0,
equation (15) has a unique solution (or has no solution). As a result, the
ability to control the shape of the segment being constructed is lost.
Example 1 (Bezier
segment shape control).
Let the cubic Bezier segment 0-1 be fixed
by specifying the control points
Q1,
P1
on
the tangents
τ0,
τ1
(Fig.
3). We must find a cubic segment 1-2 that provides smoothness
G2
at the butt point 1 and touching the straight line
τ2
at its
endpoint 2.
Figure
3. Controlling the shape of a Bezier segment
We assign a value
to the parameter
λ1,
for
example,
λ1 =4.
Calculate the coordinates (20) of the control point
Q2
of
segment 1-2. We calculate the value (22) of the parameter
μ1.
Calculate
the coordinates (16) of the control point
P2
of segment 1-2.
Result: a Bezier segment satisfying the specified boundary conditions is found.
At the junction point 1, segments 0-1 and 1-2 have the same radius of
curvature.
Assigning different
values to the parameter
λ1
(λ1
= 4.0,
4.2, 4.5), we obtain Bezier segments 1-2 of different shapes, but with the same
curvature at the junction point 1 (see Fig. 3).
Write
the equation of the Bezier curve
AB
in projections on the
x, y
axis:
|
(23)
|
Depending
on the position of the point
and the control
points
, we obtain curves whose shape
differs significantly (Fig. 4).
Fig. 4. Types of
cubic Bézier curves
Additionally, we
consider two special cases: 1) the tangents
τA,
τB
at the
end points of the segment
AB
are parallel to each other; 2) one of the
control points (Q
or
P) coincides with the point
X
of the
intersection of the tangents (
).
Theorem 1.
If the tangents
τA,
τB
at the
end points of the Bezier segment
AB
are parallel to each other, then the
curvature of the segment at point
A
is determined only by the position
of the control point
Q
τA
(it does
not depend on the position of the control point
P
τB).
Similarly, due to the symmetry of the Bezier segment, its curvature at point B
does not depend on the position of the control point
Q
τA;
it is
only determined by the position of point
P
τB.
Proof.
The curvature of segment (23) at
its starting point
A
is calculated by the formula
|
(24)
|
We
must show that for
τ
A
||
τB,
the
curvature of
KA
does not depend on the position of the point
P(xP,
yP).
Differentiating
(23) by the parameter
t
and substituting
t=0, we obtain:
|
(25)
|
According
to (25), the denominator of expression (24) does not depend on the coordinates
xP,
yP
of the control point
P. It is sufficient to show
that the numerator of this expression also does not depend on the coordinates
of point
P. Substituting (25) into (24) and performing some algebraic
transformations, we obtain an expression for the numerator
×
(without
taking into account the constant coefficient):
|
(26)
|
The
first two terms of this expression, containing the coordinates of the point
P,
are mutually reduced, since, due to the parallelism of the tangents, the
equality
is true.
Thus, neither the
denominator nor the numerator of expression (24) depends on the coordinates of
point
P; the theorem is proved. In particular, Bezier segments
r, rʹ,
rʹʹ
with a common control point
Q
and different control
points
P, pʹ, pʹʹ,
despite their different shapes, have
the same curvature at point A (Fig. 4, e).
Theorem 2.
If the vertices
A, Q, P
of the characteristic polyline
AQPB
of
the Bezier segment are collinear, then, regardless of the position of point
B,
the curvature of segment
AB
at point
A
is zero (Fig. 5, left).
Similarly, if the vertices
B, Q, P
are located collinearly, then,
regardless of the position of point
A, the curvature of the segment
AB
at point
B
is zero (Fig. 5, right).
Proof.
Let
points
A, Q, P
be collinear (incident to the tangent
τA).
The
equation of the tangent
τA
has
the form
, therefore:
.
|
|
Substituting
yQ,
yP
into (25), we find derivatives
Substituting them into expression
(24), we make sure that the numerator of this expression is zero; the second
part of the theorem is thus proved.
Fig. 5. For
Theorem 2
Corollary of
Theorem 2.
If the control points
Q, P
of characteristic polyline segment
AQPB
Beziers match, the curvature of the segment end points
A, B
is equal to
zero (Fig. 4, f).
The corollary of Theorem
2 allows for a
G2-smooth composite curve to be designed with
zero curvature in the junction points: it is only necessary to combine the
control points of the segments with the points of intersection of tangents at
the endpoints of these segments.
Example 2
(smooth conjugation of straight lines with cubic curves).
We must draw a
G2-smooth
composite curve passing through the points 0, 1, 2, 3, which is touching the
given straight lines
τ0,
τ1,
τ2,
τ3
(Fig.
6) at these points. We combine the control points
P1,
Q1
of the first segment 0-1 with the point
X1
=
τ0
∩
τ1.
Similarly,
we combine the control points
P2,
Q2
of the
second segment 1-2 with the point
X2
=
τ1
∩
τ2,
and
so on. We obtain a curve consisting of cubic Bezier segments with zero
curvature at the junction points, the most tightly of all possible
G2
curves adjacent to its characteristic polyline.
Fig. 6.
Composite curve with zero curvature at the butt points
In conclusion of
this section we note the "involutional" property of the cubic Bezier
curve: when renaming the reference points
A↔B
and the control
points
Q↔P
simultaneously, the shape of the Bezier segment
AB
does not change. This follows directly from the consideration of the structure
of equation (23), taking into account the fact that for any value of
t
[0, 1], the Bernstein polynomial
is equal to one.
Recall the
condition of local problem 2 (see paragraph 2): construct a Bezier segment 0-1 by
specifying the directions of tangents
τ0,
τ1
and
the curvature values
K0,
K1
at the end
points 0, 1. We shall look for a solution in the form (1):
The
control points
Q(xQ,
yQ),
P(xP,
yP) must be determined from the incident conditions
Q
τ0,
P
τ1
and from the
conditions of equality of curvature at the ends of the segment to the values
K0,
K1. The curvature of a plane curve, given explicitly
y
=y(x),
is calculated by the formula
|
(27)
|
The
values of
and
are known (equal to the tangents
d0,
d1
of the angles of inclination of the tangents
τ0,
τ1
to the
x
axis), so the values of the second derivatives
at
the end points of the segment being constructed can be found from (27).
According
to the known rules of differentiation of a complex function, we obtain:
,
|
(28)
|
.
|
(29)
|
Substituting
(28) into (29), we obtain:
.
|
(30)
|
We
differentiate (1) by the parameter
t:
|
(31)
|
Substituting
(31) into (30), we obtain:
|
(32)
|
Equations
(32) include unknown quantities
xQ,
yQ,
xP,
yP. Given that
Q
τ0,
P
τ1,
we write:
.
|
(33)
|
Substituting
(33) into (32), we exclude the unknowns
yQ,
yP.
After algebraic transformations, we obtain a system of explicit equations with
respect to the unknowns
xP,
xQ:
|
(34)
|
where
ψP,
ψQ
are constant coefficients:
Solving
equations (34) with respect to
xP,
xQ
and
considering (33), we find the coordinates of the control points
Q(xQ,
yQ),
P(xP,
yP) of
the Bezier segment with a given curvature
K0,
K1
at the end points.
The nonlinear
system of equations (34) can be solved graphically. Draw parabola
xP
=
f(xQ)
(the first equation) and parabola
xQ
=
g(xP)
(the second equation). At the intersection points of the parabolas
f∩g,
we obtain the values of the unknown
xQ,
xP.
According to (33), we calculate the values of
yQ,
yP.
The control points are determined.
Note.
Intersecting
at four points, the parabolas give four solutions to the system of equations
(34) (four variants of the characteristic polyline). All four variants induce
Bezier segments with the same curvature modulus |K0| at the
starting point of the segment, and the same curvature modulus |K1|
at the end point. At the same time, only one option corresponds to the predetermined
curvature sign at the ends of the segment being constructed.
Example 3
(conjugation of two circles).
We must construct a cubic Bezier
curve smoothly connecting two given circles with radii
RA,
RB.
The conjugation points
A, B
are indicated on the circles (Fig. 7). Having
drawn, according to (34), the parabolas
xP
=
f(xQ)
and
xQ
=
g(xP), we mark their intersection
points 1, 2, 3, 4. We obtain four solutions of the system of equations (34).
Each solution corresponds to a cubic Bezier segment with specified radii of
curvature
RA,
RB
at the boundary points
A,
B. Figure 7 shows the construction of control points
Q1,
P1
of the cubic segment No. 1 corresponding to point 1 of the intersection of parabolas.
Fig. 7.
Conjugation of two circles
Example 4
(conjugation of a straight line and a circle).
The direction
T
A
of a straight line passing through point
A
is indicated. The point
B
is indicated on the circle
RB(Fig. 8). It is required to
construct a transition curve
AB, smoothly (without curvature jumps)
connecting a straight line and a circle.
Figure 8. Conjugate a circle and a straight line
The curvature of
the transition curve at point
A
must be zero. Therefore, according to
Theorem 2, the control point
P
of the desired curve must coincide with
the intersection point of the directions
TA,
TB.
Here
T
B
is a vector touching the circle
RB
at point
B.
Substituting η0
=η
A
=0
into the first equation (34), we obtain a degenerate parabola
xP
=const.
Substituting the calculated value of
η1
=|ηB|
into
the second equation (34), we obtain two parabolas
xQ
=
F(xP)
and
xQ
=
F
ʹ(xP). We mark the
points
U, Uʹ
of the intersection of the parabolas with a straight
line
xP
=const. We obtain characteristic polylines
(A-Q-P-B)
and (A-Qʹ-Pʹ-B), which correspond to Bezier segments No. 1 and
No. 2. The task condition is satisfied by segment #1.
Example 5 (closed
G2
is a smooth contour).
We must
form a smooth, closed contour touching the sides of the square at points 0, 1,
2, 3. The radius of curvature is set at point 0.
The problem has
many solutions. Using a composite cubic Bezier curve, we can obtain both
symmetric (Fig. 9, a, b) and asymmetric (Fig. 9, c, d) closed
G2-smooth
contours satisfying the conditions of the problem. When constructing the
contours, algorithms for solving local problems 1 and 2 were used.
Figure 9. Closed G2-smooth contour (options)
A physical spline
is a line formed by the axis of an elastic rod passing through predetermined
points. It is assumed that the dimensions of the cross-section of the rod are
very small compared to the length and radius of curvature of its axis. An
example of such a spline is an elastic metal ruler. Passing through points set
on the plane, the ruler naturally acquires a shape with minimum energy of
internal stresses and minimum average curvature. The theoretical equation of a
physical spline can be found only under the condition of small deflections
(small deviations from a straight line). In this case, the physical spline is
satisfactorily described by a composite piecewise cubic polynomial curve of the
second degree of smoothness [10]. For large deflections, the solution becomes
fundamentally more complicated. According to [6], it reduces to a variational
problem that has no elementary solution. Therefore, it is advisable to model a
physical spline with large deflections experimentally, followed by
approximation of the resulting curve.
The simplest
physical spline.
A physical spline passes through points
A, B, C(Fig. 10, left). A "three-point" spline with free ends can be called
the simplest physical spline. We must find an analytical function that gives a
satisfactory approximation to the elastic line of the simplest spline.
The desired
function must satisfy three groups of local conditions: incidence to the
reference points
A, B, C; tangency of the lines
τA,
τB,
τC;
and zero
curvature at points
A, C. The problem cannot be solved using a standard
NURBS curve that does not account for the pre-defined local geometric
characteristics of the simulated line. Euler elastics are also inapplicable,
since there is no axial force acting on the elastic element [5].
We shall look for
a solution in the form of a composite
G2-smooth cubic Bezier
curve. We divide the elastic line into sections
AB
and
BC, each
of which is replaced by a cubic Bezier segment. To ensure zero curvature at
point
A, we combine the control point
P1
of segment
AB
with the intersection point of tangents
τA,
τB
(see
Theorem 2). By moving the control point
Q1
along the tangent
τA,
we
achieve the required accuracy of the approximation of the section
AB. To
ensure zero curvature at point
C, we combine the control point
Q2
with the intersection point of the tangents
τB,
τC
(see
Theorem 2). Calculate the value of the parameter
λB
(see
paragraph 3.3):
.
|
|
Through
formula (22) we find the value of the parameter
μ,
at which the
condition (18) of a smooth connection of the segments
AB
and
DC
is fulfilled. Substituting the found values
λB
and
μ
in
(16), we obtain the coordinates of the control point
P2. The
control points of the
BC
segment are fully defined. The composite cubic
curve
AB+BC
satisfies all boundary conditions. The approximation error
does not exceed 1.5% (Fig. 10, right).
Figure 10. The simplest physical spline: photo (left) and approxima-tion (right)
General physical
spline.
An elastic element with free ends passes through the reference points 0, 1,
..., 4. At the reference points we mark the tangents
τ0, …,
τ4
(Fig.
11, left). We must find a
G2-smooth approximating function
passing through points 0, 1, ..., 4 and touching the lines
τ0, …,
τ4.
The
curvature of the approximating function at the end points 0 and 4 should be
zero. Let us look for a solution in the form of a curve composed of four cubic
Bezier segments.
The first segment.
The
control point
P1
of the first segment 0-1 is combined with
the intersection point of the tangents
τ0,
τ1.
Result: the curvature of segment 0-1 at the starting point is zero (see Theorem
2). By moving the control point
Q1
along the tangent
τ0,
we
achieve a satisfactory approximation of the first section of the physical
spline.
The second segment.
Specifying
the control point
Q2
τ1,
we
find the control point
P2
τ2.
The
position of point
P2
functionally depends on the position of
point
Q2
(see paragraph 3.3). By moving the point
Q2
along the tangent
τ1,
we
achieve a satisfactory approximation of the second section of the physical
spline.
The third segment.
Specifying
the control point
Q3
τ2,
we
find the control point
P3
τ3.
The
position of point
P3
functionally depends on the position of
point
Q3. By moving the point
Q3
along the
tangent
τ2,
we
achieve a satisfactory approximation of the third section of the physical
spline.
The fourth segment.
We
combine the control point
Q4
with the intersection point of
the tangents
τ3,
τ4.
Result: the curvature of the Bezier segment 3-4 at the endpoint 4 is zero (see
Theorem 2). The curvature at the ends of the fourth segment is fixed, so its
shape cannot be controlled (see paragraph 5). Nevertheless, the Bezier segment
3-4 satisfactorily approximates the fourth section of the physical spline. The
approximation error is less than 2% (Fig. 11, right).
Figure 11. General view physical spline approximation (photo and drawing)
Flat, graphically
defined irregular curves are found in various engineering problems. To use such
a curve in the design process, it must be approximated with the necessary accuracy
through a relatively simple analytical function (or a set of such functions
interconnected with a certain degree of smoothness). A compromise between
accuracy and simplicity of mathematical description can be achieved through the
use of composite cubic Bezier curves. The practical application of such curves
is complicated by the absence in the technical literature of algorithms for
calculating the coordinates of the control points of Bezier segments which
account for the pre-set local characteristics of the curve being constructed
(such as tangents and curvature at the nodal and end points).
The article
proposes an algebraic algorithm (paragraph 3.2,
Local problem
1) and a
program module (paragraph 3.3, software implementation) that can be used to determine
the coordinates of the control points of the connected Bezier segments and control
the shape of the segments without disturbing the order of smoothness
G2
at the junction points. It is shown that the solution of the smooth docking
problem reduces to the solution of the quadratic equation (18).
A graphoanalytic
algorithm for constructing a planar cubic Bezier segment given by the values of
the first and second derivatives at the ends of the segment (paragraph 5,
Local
problem
2) is compiled. The search for control points of such a segment is
reduced to solving a system of two quadratic equations (34) or to determining
the coordinates of the intersection points of two drawn parabolas. The
developed algorithms are used to approximate the experimentally obtained
physical spline. The approximation error was less than 2%
1. Glaeser G. Geometrie und ihre
Anwendungen in Kunst, Natur und Technik / G. Glaeser. – Springer Spektrum,
2014. – 508 pp.
–
DOI 10.1007/978-3-642-41852-5
2. Bezye P. Geometricheskiye metody // Matematika i
SAPR. 2.
Moscow,
Mir, 1989, p. 96-257. [in Russian].
3. Grigoryev M.I., Malozemov V.N.,
Sergeyev A.N.
Bernstein
polynomials and compound Bezier curves.
Zhurnal vychislitelnoy matematiki i
matematicheskoy fiziki [Journal of Computational Mathematics and Mathematical Physics],
2006. V. 46, I. 11: p. 1962-1971.
[in Russian].
4. Panchuk K.
Spline Curves Formation Given Extreme Derivatives / K. Panchuk, T. Myasoedova,
E. Lyubchinov. – Mathematics
2021, 9(1), 47.
https://doi.org/10.3390/math9010047
5. Rabotnov Yu. N. Soprotivleniye materialov [Strength of materials].
Moscow, 1963, 456 p. [in Russian].
6. Foks A., Pratt M. Vychislitel'naja
geometrija. Primenenie v proektirovanii i na proizvod-stve [Computing Geometry.
Application in Design and on Production], Moscow, Mir, 1982, 304 p. [in
Russian].
7. Golovanov N.N. Geometricheskoe
modelirovanie [Geometric Modeling]. Moscow, 2012. 472 p.
[in Russian].
8. Pliss L.I., Shikin E.V. Krivye i
poverkhnosti na ekrane komp'yutera [Curves and Surfaces for Computer Screen],
Moscow, Dialog-MIFI Publ., 1996, 240 p [in Russian].
9. Korotkiy W.A. Cubic curves in
engineering geometry. Geometriya i grafika [Geometry and graphics], 2020. V. 8.
I. 3: p. 3-24 (in Russian) - DOI: 10.12737/2308-4898-2020-3-24
[in Russian].
10. Zav'yalov YU.S., Leus V.A, Skorospelov
V.A. Splajny v inzhenernoj geometrii [Splines in engineering geometry], Moscow,
Mashinostroenie, 1985, 224 p [in Russian].