In this section, we discuss both the existence and the fast computation of self-intersections in cubic Bézier curves.
Section 2.1 provides a brief introduction to cubic Bernstein basis functions and cubic Bézier curves.
Section 2.2 discusses the scenario where the four control points of the cubic Bézier curve are collinear, while
Section 2.3 covers the case in which they are not collinear.
2.1. Cubic Bernstein Basis Functions and Bézier Curves
Bernstein basis functions are polynomials that have a partition of unity and are non-negative over the interval
. Bernstein basis functions of degree
n are expressed as
for
.
Figure 1a illustrates cubic Bernstein basis functions with
.
The Bernstein basis functions (
1) form the mathematical foundation of Bézier curves, a class of parametric curves extensively used in computer graphics, animation, and CAD systems due to their intuitive design and easy computation. A cubic Bézier curve is defined as a linear combination of four control points
(
), with the degree-3 Bernstein basis functions as coefficients. Then, a cubic Bézier curve is defined as the image of the following vector-valued parametric function [
1]
Figure 1b illustrates a cubic Bézier curve. Due to the specific properties of Bernstein polynomials, such as the fact that the sum of their values at any given
is always one, the resulting Bézier curve exhibits strong stability and predictable behavior, making it a preferred tool for curve design. The partition of unity and non-negativity property of Bernstein basis functions ensures that the curve lies within the convex hull of its control points
(
). In addition, Bézier curves possess the affine invariance property, meaning that their shape is preserved under affine transformations, providing a useful property for various geometric modeling applications and computations.
Self-intersections in cubic Bézier curves are of significant interest due to their implications in design and rendering processes. A cubic Bézier curve may intersect itself depending on the geometric configuration of its control points when there are distinct parameters
and
such that
.
Figure 2a shows a cubic Bézier curve that is free of self-intersections, while
Figure 2b presents a cubic Bézier curve that intersects itself due to the placement of specific control points. Both serve as examples for understanding the geometric implications of control point configurations in curve design.
2.2. Cubic Bézier Curves with Collinear Control Points
Consider the four control points
of a cubic Bézier curve
to be collinear, i.e., satisfying
. Thanks to the affine invariance property of Bézier curves, its shape remains unaltered by translation and rotation transformations. Therefore, we apply Rodrigues’ rotation formula to translate and rotate the control points
to
, positioning
at the origin
and aligning
along the positive
x-axis at a distance
, i.e.,
. This adjustment sets the
x-coordinate of
to
. Under these transformations, the cubic Bézier curve
, redefined by the control points
, simplifies to a linear trajectory along the
x-axis, and can be expressed as
To analyze the trend of the cubic Bézier curve
, we examine its derivative as derived from Equation (
3)
The monotonicity of
hinges on the solvability of its derivative function
. Concurrently, the presence of solutions for the derivative function, as defined in Equation (
4), is contingent upon the value of its discriminant
Based on the calculations in (
3)–(
5), we are now prepared to articulate the following theorem.
Theorem 1. Consider the set of control points lying on a straight line, fulfilling the condition , for a cubic Bézier curve . The cubic Bézier curve is self-overlapping if and only if holds; otherwise it has no self-intersections.
Proof. Upon applying translation and rotation to the curve
as defined in Equation (
3), a condition arises where
leads to a consistently positive discriminant in Equation (
5). Under these circumstances, the quadratic derivative function
in Equation (
4) possesses two distinct roots, indicating a change in the monotonicity of the cubic function
at these roots. Given that the control points are aligned collinearly, the cubic Bézier curve
is constrained to the line defined by these points and maintains continuity. A change in monotonicity thus signifies self-overlapping within the curve. In contrast, the absence of such a change denotes a monotonic
devoid of self-intersections.
According to the affine invariance property of Bézier curves, it follows that retains the identical geometric relationships as . □
Theorem 1 serves as a pivotal tool for identifying the presence of a self-intersection, or more precisely, a self-overlap in cubic Bézier curves when their control points are aligned collinearly. In the following subsection, our discussion will expand into scenarios where cubic Bézier curves exhibit non-collinear control points.
2.3. Cubic Bézier Curves with Non-Collinear Control Points
Consider the four non-collinear control points
, for
, of a cubic Bézier curve
. The problem of identifying self-intersections within this curve boils down to determining the parameters
and
such that
while simultaneously ensuring
. From the definition in Equation (
2), that is,
To streamline our analysis, similarly, we reposition the control points to , where and set as the origin. The resulting cubic Bézier curve, represented by the control points and denoted as , retains identical geometric properties to .
Substituting the control points
and the cubic Bernstein basis functions
into Equation (
6), we have
To discuss the solutions of the system (
7), we first organize the cubic Bernstein basis functions
as follows:
For a polynomial parametric curve, denoted as
, the equation characterizing self-intersections, originally expressed as
, can be transformed into
. It allows for the exclusion of the trivial solution
, thereby simplifying the process and focusing on non-trivial intersections, which is also referred to as the algebraic decomposition approach. By employing this strategy, we denote
,
. Equation (
8) is substituted into Equation (
7) and the non-zero common factor
is eliminated. Then, the system of cubic equations in Equation (
7) can be equivalently expressed as the following linear system
Now, the task at hand is to solve the linear system (
9) to effectively determine the self-intersections of cubic Bézier curves.
Equation (
9) are abbreviated as
where
is the coefficient matrix, and
denotes its augmented matrix.
To elucidate the resolution of the linear system in Equation (
10), we introduce the following lemma:
Lemma 1. Consider a set of four non-collinear control points of a cubic Bézier curve. The rank of the augmented matrix is determined to be either 2 or 3.
Proof. First of all,
if and only if all control points are the same, which falls into the collinear case in
Section 2.2. Therefore,
holds. Utilizing elementary matrix transformations, we can deduce that
It is evident that the rank of the augmented matrix
cannot exceed 3. If
, it effectively implies that
. Consequently, there must be two non-zero constants,
and
, leading to the matrix transformation:
which would imply collinearity among the control points
, contradicting their non-collinearity. Therefore, we draw the conclusion that
or 3. □
Lemma 1 offers a thorough analysis of the rank of the augmented matrix
, providing a theoretical basis for the subsequent discussion. According to the foundational principles of linear algebra, we may readily classify the solutions to the binary linear equations system as delineated in Equation (
10) by classifying the rank of the coefficient matrix
and the augmented matrix
. Consequently, we present the following theorem without the need for further proof.
Theorem 2. For the four non-collinear control points defining a cubic Bézier curve, the resolution of Equation (10) can be classified as - (1)
If , then Equation (10) has no solution, implying the cubic Bézier curve does not exhibit self-intersections; - (2)
If , then Equation (10) has a unique solution and ; - (3)
When , an infinite number of solutions is theoretically possible. Nevertheless, Lemma 1 negates the feasibility of this case.
Remark 1. A similar analysis method can be applied to compute the self-intersections of quadratic Bézier curves. It is easy to know that when the three control points of a quadratic Bézier curve are non-collinear, there is no self-intersection.
In the context of case (2) outlined in Theorem 2, determining the self-intersection points of the cubic Bézier curve
necessitates solving a set of binary quadratic equations:
From the second equation in Equation (
11), it can be deduced that
. Substituting this into the first equation yields a quadratic equation:
solvable using the quadratic formula. For
, the roots are given by
Given the symmetry between
and
in Equation (
11),
and
represent the solutions. If both
and
fall within the interval
, then
indicates a self-intersection point of the cubic Bézier curve
. In the absence of such conditions, the curve
does not self-intersect. This rationale equally pertains to the curve
.
Remark 2. The analysis of planar cubic Bézier curves presents a more streamlined scenario. To find the solution, it suffices to address only the initial two equations from Equation (9). A unique solution exists if and only if the condition is met, with and representing the matrices formed from the first two rows of and , respectively. Following the above discussion, we introduce the following algorithm (Algorithm 1) specifically formulated to compute self-intersections in cubic Bézier curves. The accuracy of the obtained results can be verified by substituting them back into the expression for the cubic Bézier curve. In fact, Algorithm 1 is known to accurately identify all self-intersections of the cubic Bézier curve, according to the basic principles of linear algebra.
Algorithm 1: Computing Self-Intersections in Cubic Bézier Curves |
|