Composite Bézier curve
   HOME

TheInfoList



OR:

In geometric modelling and in
computer graphics Computer graphics deals with generating images with the aid of computers. Today, computer graphics is a core technology in digital photography, film, video games, cell phone and computer displays, and many specialized applications. A great de ...
, a composite Bézier curve or Bézier spline is a spline made out of Bézier curves that is at least C^0
continuous Continuity or continuous may refer to: Mathematics * Continuity (mathematics), the opposing concept to discreteness; common examples include ** Continuous probability distribution or random variable in probability and statistics ** Continuous ...
. In other words, a composite Bézier curve is a series of Bézier curves joined end to end where the last point of one curve coincides with the starting point of the next curve. Depending on the application, additional smoothness requirements (such as C^1 or C^2 continuity) may be added. A continuous composite Bézier is also called a polybezier, by similarity to
polyline In geometry, a polygonal chain is a connected series of line segments. More formally, a polygonal chain is a curve specified by a sequence of points (A_1, A_2, \dots, A_n) called its vertices. The curve itself consists of the line segments co ...
, but whereas in polylines the points are connected by straight lines, in a polybezier the points are connected by Bézier curves. A beziergon (also called bezigon) is a closed path composed of Bézier curves. It is similar to a
polygon In geometry, a polygon () is a plane figure that is described by a finite number of straight line segments connected to form a closed ''polygonal chain'' (or ''polygonal circuit''). The bounded plane region, the bounding circuit, or the two to ...
in that it connects a set of vertices by lines, but whereas in polygons the vertices are connected by straight lines, in a beziergon the vertices are connected by Bézier curves. Some authors even call a C^0 composite Bézier curve a "Bézier spline"; the latter term is however used by other authors as a synonym for the (non-composite) Bézier curve, and they add "composite" in front of "Bézier spline" to denote the composite case. Perhaps the most common use of composite Béziers is to describe the outline of each letter in a PostScript or PDF file. Such outlines are composed of one beziergon for
open letters An open letter is a letter that is intended to be read by a wide audience, or a letter intended for an individual, but that is nonetheless widely distributed intentionally. Open letters usually take the form of a letter addressed to an indiv ...
, or multiple beziergons for closed letters. Modern
vector graphics Vector graphics is a form of computer graphics in which visual images are created directly from geometric shapes defined on a Cartesian plane, such as points, lines, curves and polygons. The associated mechanisms may include vector display ...
and
computer font A computer font is implemented as a digital data file containing a set of graphically related glyphs. A computer font is designed and created using a font editor. A computer font specifically designed for the computer screen, and not for print ...
systems like PostScript,
Asymptote In analytic geometry, an asymptote () of a curve is a line such that the distance between the curve and the line approaches zero as one or both of the ''x'' or ''y'' coordinates tends to infinity. In projective geometry and related context ...
, Metafont,
OpenType OpenType is a format for scalable computer fonts. It was built on its predecessor TrueType, retaining TrueType's basic structure and adding many intricate data structures for prescribing typographic behavior. OpenType is a registered trademark ...
, and SVG use composite Bézier curves composed of cubic Bézier curves (3rd order curves) for drawing curved shapes.


Smooth joining

A commonly desired property of splines is for them to join their individual curves together with a specified level of parametric or geometric continuity. While individual curves in the spline are fully C^\infin continuous within their own interval, there is always some amount of discontinuity where different curves meet. The Bézier spline is fairly unique in that it's one of the few splines that doesn't guarantee any higher degree of continuity than C^0. It is, however, possible to arrange control points to guarantee various levels of continuity across joins, though this can come at a loss of local control if the constraint is too strict for the given degree of the Bézier spline.


Smoothly joining cubic Béziers

Given two cubic Bézier curves with control points mathbf P_0,\mathbf P_1,\mathbf P_2,\mathbf P_3/math> and mathbf P_3,\mathbf P_4,\mathbf P_5,\mathbf P_6/math> respectively, the constraints for ensuring continuity at \mathbf P_3 can be defined as follows: * C^0/G^0 (positional continuity) requires that they meet at the same point, which all Bézier splines do by definition. In this example, the shared point is \mathbf P_3 * C^1 (velocity continuity) requires the neighboring control points around the join to be mirrors of each other. In other words, they must follow the constraint of \mathbf P_4=2\mathbf P_3-\mathbf P_2 * G^1 (tangent continuity) requires the neighboring control points to be
collinear In geometry, collinearity of a set of points is the property of their lying on a single line. A set of points with this property is said to be collinear (sometimes spelled as colinear). In greater generality, the term has been used for aligned o ...
with the join. This is less strict than C^1 continuity, leaving an extra degree of freedom which can be parameterized using a scalar \beta_1. The constraint can then be expressed by \mathbf P_4=\mathbf P_3+(\mathbf P_3-\mathbf P_2)\beta_1 While the following continuity constraints are possible, they are rarely used with cubic Bézier splines, as other splines like the B-spline or the β-spline will naturally handle higher constraints without loss of local control. * C^2 (acceleration continuity) is constrained by \mathbf P_5 =\mathbf P_1+4(\mathbf P_3-\mathbf P_2). However, applying this constraint across an entire cubic Bézier spline will cause a cascading loss of local control over the tangent points. The curve will still pass through every third point in the spline, but control over its shape will be lost. In order to achieve C^2 continuity using cubic curves, it's recommended to use a cubic uniform B-spline instead, as it ensures C^2 continuity without loss of local control, at the expense of no longer being guaranteed to pass through specific points * G^2 (curvature continuity) is constrained by \mathbf P_5=\mathbf P_3+(\mathbf P_3-\mathbf P_2)(2\beta_1+\beta_1^2+\beta_2/2)+(\mathbf P_1-\mathbf P_2)\beta_1^2, leaving two degrees of freedom compared to C^2, in the form of two scalars \beta_1 and \beta_2. Higher degrees of geometric continuity is possible, though they get increasingly complex * C^3 (jolt continuity) is constrained by \mathbf P_6=\mathbf P_3+(\mathbf P_3-\mathbf P_0)+6(\mathbf P_1-\mathbf P_2+\mathbf P_3-\mathbf P_2). Applying this constraint to the cubic Bézier spline will cause a complete loss of local control, as the entire spline is now fully constrained and defined by the first curve's control points. In fact, it is arguably no longer a spline, as its shape is now equivalent to extrapolating the first curve indefinitely, making it not only C^3 continuous, but C^\infin, as joins between separate curves no longer exist


Approximating circular arcs

In case circular arc primitives are not supported in a particular environment, they may be approximated by Bézier curves. Commonly, eight quadratic segments or four cubic segments are used to approximate a circle. It is desirable to find the length \mathbf of control points which result in the least approximation error for a given number of cubic segments.


Using four curves

Considering only the 90-degree unit-circular arc in the
first quadrant A Cartesian coordinate system (, ) in a plane is a coordinate system that specifies each point uniquely by a pair of numerical coordinates, which are the signed distances to the point from two fixed perpendicular oriented lines, measured in ...
, we define the endpoints \mathbf and \mathbf with control points \mathbf and \mathbf, respectively, as: : \begin \mathbf & =
, 1 The comma is a punctuation mark that appears in several variants in different languages. It has the same shape as an apostrophe or single closing quotation mark () in many typefaces, but it differs from them in being placed on the baseline o ...
\\ \mathbf & = mathbf, 1\\ \mathbf & = , \mathbf\\ \mathbf & =
, 0 The comma is a punctuation mark that appears in several variants in different languages. It has the same shape as an apostrophe or single closing quotation mark () in many typefaces, but it differs from them in being placed on the baseline ...
\\ \end From the definition of the cubic Bézier curve, we have: :\mathbf(t)=(1-t)^3\mathbf + 3(1-t)^2t\mathbf+3(1-t)t^2\mathbf+t^3\mathbf With the point \mathbf(t=0.5) as the midpoint of the arc, we may write the following two equations: : \begin \mathbf &= \frac\mathbf + \frac\mathbf+\frac\mathbf+\frac\mathbf \\ \mathbf &= \sqrt = \sqrt/2 \end Solving these equations for the x-coordinate (and identically for the y-coordinate) yields: :\frac\mathbf + \frac\mathbf+\frac + \frac = \sqrt/2 :\mathbf = \frac(\sqrt - 1) \approx 0.5522847498 Note however that the resulting Bézier curve is entirely outside the circle, with a maximum deviation of the radius of about 0.00027. By adding a small correction to intermediate points such as : \begin \mathbf & = mathbf+0.0009, 1-0.00103\\ \mathbf & = -0.00103, \mathbf+0.0009, \end the magnitude of the radius deviation to 1 is reduced by a factor of about 3, to 0.000068 (at the expense of the derivability of the approximated circle curve at endpoints).


General case

We may compose a circle of radius R from an arbitrary number of cubic Bézier curves. Let the arc start at point \mathbf and end at point \mathbf, placed at equal distances above and below the x-axis, spanning an arc of angle \theta = 2\phi: :\begin \mathbf_x &= R\cos(\phi) \\ \mathbf_y &= R\sin(\phi) \\ \mathbf_x &= \mathbf_x \\ \mathbf_y &= -\mathbf_y \end The control points may be written as: :\begin \mathbf_x &= \frac \\ \mathbf_y &= \frac \\ \mathbf_x &= \mathbf_x \\ \mathbf_y &= -\mathbf_y \end


Examples

File:Circle and quadratic bezier.svg, Eight-segment quadratic polybezier (red) approximating a circle (black) with control points File:Circle and cubic bezier.svg, Four-segment cubic polybezier (red) approximating a circle (black) with control points


Fonts

TrueType TrueType is an outline font standard developed by Apple in the late 1980s as a competitor to Adobe's Type 1 fonts used in PostScript. It has become the most common format for fonts on the classic Mac OS, macOS, and Microsoft Windows operating ...
fonts use composite Béziers composed of quadratic Bézier curves (2nd order curves). To describe a typical
type design Type design is the art and process of designing typefaces. This involves drawing each letterform using a consistent style. The basic concepts and design variables are described below. A typeface differs from other modes of graphic production su ...
as a
computer font A computer font is implemented as a digital data file containing a set of graphically related glyphs. A computer font is designed and created using a font editor. A computer font specifically designed for the computer screen, and not for print ...
to any given accuracy, 3rd order Beziers require less data than 2nd order Beziers; and these in turn require less data than a series of straight lines. This is true even though any one straight line segment requires less data than any one segment of a parabola; and that parabolic segment in turn requires less data than any one segment of a 3rd order curve.


See also

* B-spline


References

{{DEFAULTSORT:Bezier Spline Splines (mathematics)