Abstract
Recently, Yu et al. derived a factorization procedure for detecting and computing the potential self-intersection of 3D integral Bézier cubics, claiming that their proposal distinctly outperforms existing methodologies. First, we recall that in the 2D case, explicit formulas already exist for the parameter values at the self-intersection (the singularity called crunode in algebraic geometry). Such values are the solutions of a quadratic equation, and affine invariants depend only on the curve hodograph. Also, the factorization procedure for cubics is well known. Second, we note that only planar Bézier cubics can display a self-intersection, so there is no need to address the problem in the more involved 3D setting. Finally, we elucidate the connections with the previous literature and provide a geometric interpretation, in terms of the affine classification of cubics, of the algebraic conditions necessary for the existence of a self-intersection. Cubics with a self-intersection are affine versions of the celebrated Tschirnhausen cubic.
Keywords:
affine classification; Bézier cubic; crunode; double point; factorization; integral cubic; loop; self-intersection; singularity; Tschirnhausen cubic MSC:
11G30
1. Introduction
Integral (i.e., polynomial) cubics are the most popular Bézier curves in CAGD (Computer-Aided Geometric Design) [1,2] for their straightforward analysis and beautiful simplicity [3], especially compared to their rational or higher-order counterparts. Bézier cubics deserve our attention as they find numerous practical applications, including the following:
- Free-form design: They provide the tool to define freeform paths in vector-based design programs, such as Adobe Illustrator and Inkscape, the page-description language PostScript [4] and the Scalable Vector Graphics (SVG) format [5];
- Manufacturing: Bézier cubics are implemented as the G5 command in G-code, the standard programming language for CNC (Computer Numerical Control) and additive manufacturing [6];
- Geometry processing [7]: Cubics can be pieced together to define splines, which are employed in CAD systems to approximate geometry, such as offsets [8] or sections of sculptured surfaces.
Detecting the curve singularities is critical to these applications. In particular, a curve with a self-intersection means a loop, which violates the assumptions required for CNC milling [9]. Also, it implies that has zero reach (shortest distance to the cut locus) at , so no smooth (trimmed) tube or offset can be constructed using as the generator [10]. To compute the potential self-intersection of an integral cubic, we could resort to numerical algorithms for Bézier curves of an arbitrary degree, such as those by Lasser [11] or Farouki [12], based on subdivision. However, for the specific cubic case, simple closed-form formulas are well known.
Yu et al. [13], in a recent article in this journal and unaware of these previous explicit formulas, present an alternative analytical method in a 3D setting, claiming that it overcomes the limitations of existing algorithms. Our article contesting this claim is arranged as follows. First, Section 2 briefly reviews the rich literature, mostly overlooked in [13], on explicit methods for finding the self-intersection of plane cubics. Section 3 shows that solving the 2D case with existing techniques suffices because all Bézier cubics with a self-intersection are planar. Next, Section 4 revisits the factorization procedure employed in [13] and checks the equivalence between existing formulas. Section 5 reinterprets geometrically the algebraic conditions for the existence of a self-intersection in terms of the affine classification of cubics, concluding that all Bézier cubics with a self-intersection can be regarded as affine segments of a Tschirnhausen cubic. Finally, Section 6 closes with practical conclusions.
2. Finding the Self-Intersection of a Cubic: Existing Explicit Procedures
Finding a self-intersection [14,15] boils down to seeking a double point and, hence, pairs of distinct parameter values () such that
For integral plane cubics, a quadratic equation furnishes the values corresponding to the only double point. More than four decades ago, Wang [16] (Theorem 3) provided explicit formulas for , albeit for cubics in the power basis. Later, and unaware of [16], Su and Liu [17] (p. 265) put forward the equivalent expression in the Bernstein basis, rewritten by Degen [18] (p. 261) in terms of a pair of affine invariants. These works [16,17,18] do not detail how equality (1) is solved for , simply providing ready-to-use formulas. The methods reported by Thompson [19] or on the Mathematics Stack Exchange website [20] resort to the factorization procedure, also employed by Yu et al. [13].
The solution for integral cubics can be regarded as a particular instance of that by Patterson [21] (p. 151) for the superset of rational cubics. Unsurprisingly, also come as the roots of a quadratic polynomial, the so-called auxiliary quadratic form. Fiorot et al. [22] adapted this result to rational cubics given in the alternative BR-form controlled by a massic polygon via Bernstein polynomials.
Implicitization techniques provide another option to find . Loop and Blinn [23] obtain a simple implicit representation for rational Bézier curves based on classical algebraic geometry and derive an explicit formula for in the integral case. Chionh and Sederberg [24] extend this result to rational cubics after revealing the connection between singularities and the implicitization Bézout matrix. Barrowclough [25] also gives formulas for the rational case by devising a tailor-made basis for the implicitization of Bézier cubics. As expected, always come as the roots of a quadratic polynomial.
3. All Bézier Cubics with Self-Intersections Are Planar
In this Section, we recall that no twisted (i.e., non-planar) cubic with a self-intersection exists, a fact overlooked in [13]. Indeed, consider the Bézier form of the loop segment bounded by (Figure 1), whose control polygon has coincident endpoints and, thus, defines a triangle on a certain plane containing . Any segment of the cubic also lies on , as its control points stem from barycentric combinations of those of .
Figure 1.
Any cubic with a self-intersection lies on the plane containing the triangular Bézier polygon defining the loop.
We can easily check whether a given 3D cubic is planar by inspecting its derivative, called a hodograph [1]. This hodograph is expressible in quadratic Bézier form, with three control points, aside from a common dilation, generated by the forward difference operator as follows:
Therefore, the planarity of is tantamount to a vanishing determinant as follows:
where the differences (2) form the columns of the 3 × 3 matrix . Equivalently, rank . This condition is met by all the 3D cubics with self-intersection that Yu et al. [13] plot in their Figure 5d–f, whose control points are not generated at random as claimed but chosen to lie on a plane.
The condition rank (for either a 2D or 3D curve) means that all points are aligned and , hence, degenerates to a straight line, the only improperly parametrized cubic [26]. A non-overlapping parametrization of this line ([13], Theorem 1) amounts to the injectivity of a cubic function, a property easy to test [27]. From now on, we exclude the degenerate geometry of a straight line.
4. Finding the Parameter Values for the Double Point via Factorization
In the preceding section, we concluded that only plane cubics admit a self-intersection . Next, we focus on such curves, revisit the factorization algorithm [19,20] for finding the parameter values (1), and employ it to derive the formulas by Wang [16] (power basis) and Su and Liu [17] (the Bernstein basis), showing their equivalence.
Given a polynomial curve of arbitrary degree, both components of the bivariate difference contain the common factor [28]. We can, thus, remove the trivial solution to obtain what Farouki [12] calls reduced difference:
If is written in the power basis
then (4) admits a simple expression involving only the coefficients
If is given in Bernstein–Bézier form, we compute such coefficients as linear combinations of forward differences (2) as follows:
Setting , the values (6) come as solutions of a system of linear equations. In matrix form and writing the power coefficients as column vectors (5), the following expression is obtained:
This system admits infinite solutions if rank , where . However, using (7), rank , where is the matrix (3). Therefore, rank implies a straight line, a degenerate case ruled out in Section 2. If , Cramer’s rule furnishes the unique solution as a quotient of determinants as follows:
where the 2 × 2 square matrix is obtained by dropping in . Finally, using Viete’s formulas, the sought values are the roots of the quadratic polynomial . In terms of (6), we reach the formula by Wang [16]
or the particularized expressions for the special coordinate systems in [19,20]. Equivalently
We can employ relationship (7) to rewrite the determinants (9) as follows:
where is similarly obtained by dropping into . Substitution into (10) generates the alternative expression in Bernstein form derived by Su and Liu [17]:
Degen [18] rewrites this expression in terms of the pair of affine invariants such that , which implies that are also affine invariants. It must be warned that this formula blows up when , i.e., when the end control legs are parallel.
5. Conditions for the Existence of a Self-Intersection
The equivalent Formulas (10) and (12) for yield the self-intersection (1) only if the following three conditions are met:
- (i)
- , tantamount to : The formulas are well defined;
- (ii)
- Discriminant , tantamount to : The values are distinct and real;
- (iii)
- , when considering the Bézier segments.
Su and Liu [17] spell out the above necessary and sufficient conditions as a set of inequalities in terms of the determinants (11). Condition (i) corresponds to that described in Remark 2 (2D case) by Yu et al. [13]. In previous works [16,20], although appears to be a denominator, the possibility that it vanished is not considered.
Next, we geometrically interpret what happens when algebraic conditios (i) or (ii) is not met. First, we must answer a fundamental question: how many essentially different planar cubics are there? Let us consider cubics in untrimmed form, with , and only true cubics, hence ruling out not only straight lines but also parabolas. Based on the previous work by Wang [16], Stone and DeRose [9] answer this question. Pottmann [29] and Koprowski [30] show how the results in [9] relate to the classical theories of line and algebraic geometry, respectively. Untrimmed cubics are classified into four affine types according to their respective shapes. Formally speaking, we define four equivalence classes (Figure 2), whereby two cubics are equivalent if related by an affine map:
Figure 2.
The four affine types of integral cubics are as follows: (a) crunodal; (b) cuspidal; (c) acnodal; (d) S-shaped.
- (a)
- Crunodal (loop-shaped): One self-intersection (called crunode) and no inflections;
- (b)
- Cuspidal: One cusp but neither inflection nor self-intersections;
- (c)
- Acnodal (hump-shaped): One acnode and two inflections but no self-intersections;
- (d)
- S-shaped: One inflection but no self-intersections.
Each class is generated by its respective canonical representative [31]: (a) the Tschirnhausen cubic [32]; (b) semi-cubical parabola [32]; (c) acnodal cubic; (d) graph of the cubic function . We conclude that cubics with self-intersections are simply crunodal cubics, i.e., affine versions of the Tschirnhausen cubic. When either condition (i) or (ii) is not fulfilled, we come across other curve classes. Indeed, depending on the circumstances, on of the following points is true:
- (i)
- If , then the second derivative is either a line through the origin, which implies the inflection of type (d), or degenerates to point , which means not a true cubic but a line or a parabola.
- (ii)
- A discriminant indicates a cusp (b), the limiting case of a self-intersection where two consecutive points coincide [33], whereas implies complex values and, hence, an acnodal cubic (c). In [9,19,21,22,25], a similar analysis characterizes the double point.
Finally, recall that the visual inspection of the Bézier polygon does not directly reveal the existence of a self-intersection . However, Vincent [34] identifies a necessary (but not sufficient) condition on the polygon. He categorizes cubic polygons according to the signed areas of the triangles formed by triples of control points, proving that the existence of is possible only for the two types of polygons illustrated in Figure 3: self-intersecting or concave (but not zig-zag or convex). Yu et al. [13] call such polygons ill posed, adhering to the terminology introduced by Zhu and Zhao [35]. For rational Bézier cubics with positive weights, Chionh and Sederberg [24] derive the same configuration as a necessary condition for self-intersection. This geometry is more restrictive and, hence, encompasses the angle criterion by Lasser [11] for curves of arbitrary degree, stating that a self-intersection implies , where denotes the exterior angles of the Bézier polygon.
Figure 3.
There are only two types of Bézier polygons associated with a cubic that may display a self-intersection : (I) self-intersecting; (II) concave.
6. Conclusions
Integral cubic curves admit a self-intersection only in the planar case, so there is no need to address the problem in a 3D setting. Simple explicit formulas are well known for computing the parameter values at the potential self-intersection of a non-degenerate plane cubic (different from a straight line). Such values are affine invariants depending on the curve hodograph and come as the roots of a quadratic equation. If the cubic is given in power basis, employ expression (10) to obtain the parameter values for . In the Bernstein basis, firstly, compute the forward differences (2), from them compute the power coefficients (7), and finally (10), directly apply the equivalent Formula (12).
Formulas (10) and (12) yield a self-intersection only if three algebraic conditions, (i), (ii), and (iii), straightforward to check either in the power or Bernstein basis, are met. When (i) or (ii) are not fulfilled, we come across a cubic not of the crunodal type.
Funding
Supported by grant PID2022-137598NB-I00 funded by MCIU/AEI/10.13039/501100011033 and FEDER/EU.
Data Availability Statement
No new data were created or analyzed in this study.
Conflicts of Interest
The author declares no conflicts of interest.
Abbreviations
The following abbreviations are used in this manuscript:
| CAGD | Computer Aided Geometric Design |
| CNC | Computer Numerical Control |
References
- Farin, G. Curves and Surfaces for Computer Aided Geometric Design, 5th ed.; Morgan Kaufmann: San Francisco, CA, USA, 2001. [Google Scholar]
- Hoschek, J.; Lasser, D. Fundamentals of Computer Aided Geometric Design; AK Peters: Wellesley, MA, USA, 1993. [Google Scholar]
- Holmer, F. The Beauty of Bézier Curves. Available online: https://www.youtube.com/watch?v=aVwxzDHniEw (accessed on 6 August 2024).
- Adobe Systems. PostScript Language Tutorial and Cookbook; Addison-Wesley: Reading, MA, USA, 1985. [Google Scholar]
- Eisenberg, J.; Bellamy-Royds, A. SVG Essentials: Producing Scalable Vector Graphics with XML, 2nd ed.; O’Reilly: Sebastopol, CA, USA, 2014. [Google Scholar]
- Marlin. G5-Bézier Cubic Spline. Available online: https://marlinfw.org/docs/gcode/G005.html (accessed on 6 August 2024).
- Barnhill, R. E Geometry Processing for Design and Manufacturing; SIAM, Society for Industrial and Applied Mathematics: Philadelphia, PA, USA, 1992. [Google Scholar]
- Elber, G.; Lee, I.-K.; Kim, M.-S. Comparing curve approximation methods. IEEE Comput. Graph. Appl. 1997, 17, 62–71. [Google Scholar] [CrossRef]
- Stone, V.; DeRose, T.D. A geometric characterization of parametric cubic Curves. ACM Trans. Graph. 1989, 8, 147–163. [Google Scholar] [CrossRef]
- Sánchez-Reyes, J.; Fernández-Jambrina, L. On the reach and the smoothness class of pipes and offsets: A survey. AIMS Math. 2022, 7, 7742–7758. [Google Scholar] [CrossRef]
- Lasser, D. Calculating the self-intersections of Bézier curves. Comput. Ind. 1989, 12, 259–268. [Google Scholar] [CrossRef]
- Farouki, R.T. Reduced difference polynomials and self-intersection computations. Appl. Math. Comput. 2018, 324, 174–190. [Google Scholar] [CrossRef]
- Yu, Y.-Y.; Li, X.; Ji, Y. On Self-intersections of Cubic Bézier Curves. Mathematics 2024, 12, 882. [Google Scholar] [CrossRef]
- Patrikalakis, N.M.; Maekawa, T. Shape Interrogation for Computer Aided Design and Manufacturing; Springer: Berlin/Heidelberg, Germany, 2002. [Google Scholar]
- Maekawa, T.; Cho, W.; Patrikalakis, N.M. Computation of self-intersections of offsets of Bézier patches. J. Mech. Des. 1997, 119, 275–283. [Google Scholar] [CrossRef]
- Wang, C.Y. Shape classification of the parametric cubic curve and parametric B-spline cubic curve. Comput.-Aided Des. 1981, 13, 199–206. [Google Scholar] [CrossRef]
- Su, B.Q.; Liu, D.Y. An affine invariant and its application in computational geometry. Sci. Sin. (Ser. A) 1983, 24, 256–267. [Google Scholar]
- Degen, W. Some remarks on Bézier curves. Comput. Aided Geom. Des. 1988, 5, 259–268. [Google Scholar] [CrossRef]
- Thompson, S. On the Classification of Parametric Cubic Curves. Res. J. Math. Technol. 2013, 119, 195. [Google Scholar]
- StackExchange. 2D Cubic Bezier Curve. Point of Self-Intersection. Available online: https://math.stackexchange.com/questions/3776840/2d-cubic-bezier-curve-point-of-self-intersection (accessed on 6 August 2024).
- Patterson, R.R. Parametric curves as algebraic curves. Comput. Aided Geom. Des. 1988, 5, 139–159. [Google Scholar] [CrossRef]
- Fiorot, J.-C.; Jeannin, P.; Taleb, S. Rational cubic curves as BR-curves. Comput. Aided Geom. Des. 1995, 12, 67–88. [Google Scholar] [CrossRef]
- Loop, C.; Blinn, J. Resolution independent curve rendering using programmable graphics hardware. ACM Trans. Graph. 2005, 24, 1000–1009. [Google Scholar] [CrossRef]
- Chionh, E.-W.; Sederberg, T.W. On the minors of the implicitization Bézout matrix for a rational plane curve. Comput. Aided Geom. Des. 2001, 18, 21–36. [Google Scholar] [CrossRef]
- Barrowclough, O.J.D. A basis for the implicit representation of planar rational cubic Bézier curves. Comput. Aided Geom. Des. 2014, 31, 148–167. [Google Scholar] [CrossRef][Green Version]
- Sederberg, T.W. Improperly parametrized rational curves. Comput. Aided Geom. Des. 1986, 3, 67–75. [Google Scholar] [CrossRef]
- StackExchange. How Can You Quickly Tell If a Cubic Polynomial Gives an Injective Function? Available online: https://math.stackexchange.com/questions/2027560/how-can-you-quickly-tell-if-a-cubic-polynomial-gives-an-injective-function (accessed on 6 August 2024).
- Pekerman, D.; Elber, G.; Kim, M.S. Self-intersection detection and elimination in freeform curves and surfaces. Comput. Aided Des. 2008, 40, 140–159. [Google Scholar] [CrossRef]
- Pottmann, H. Studying NURBS curves and surfaces with classical geometry. In Mathematical Methods for Curves and Surfaces; Daehlen, M., Lyche, T., Schumaker, L., Eds.; Vanderbilt University Press: Nashville, TN, USA, 1995; pp. 413–438. [Google Scholar]
- Koprowski, P. Algebraic Approach to a Geometric Characterization of Parametric Cubics. J. Geom. Graph. 2007, 2, 173–178. [Google Scholar]
- Saito, T.; Yamada, M.; Yoshida, N. Shape analysis of cubic Bézier curves––Correspondence to four primitive cubics. Comput. Aided Des. Appl. 2014, 11, 568–578. [Google Scholar] [CrossRef]
- Lawrence, J.D. A Catalog of Special Plane Curves; Dover: New York, NY, USA, 1972. [Google Scholar]
- Peterson, O.J. The double points of rational curves. Amer. Math. Mon. 1917, 24, 376–379. [Google Scholar] [CrossRef]
- Vincent, V. Fast detection of the geometric form of two-dimensional cubic Bézier curves. J. Graph. Tools 2002, 7, 43–51. [Google Scholar] [CrossRef]
- Zhu, C.-G.; Zhao, X.-Y. Self-intersections of rational Bézier curves. Graph. Model. 2014, 76, 312–320. [Google Scholar] [CrossRef]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).