HOME

TheInfoList



OR:

In geometric modelling and in
computer graphics Computer graphics deals with generating images and art with the aid of computers. Computer graphics is a core technology in digital photography, film, video games, digital art, cell phone and computer displays, and many specialized applications. ...
, a composite Bézier curve or Bézier spline is a spline made out of
Bézier curve A Bézier curve ( , ) is a parametric equation, parametric curve used in computer graphics and related fields. A set of discrete "control points" defines a smooth, continuous curve by means of a formula. Usually the curve is intended to approxima ...
s 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 polybézier, 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 polybézier the points are connected by Bézier curves. A béziergon (also called bézigon) is a closed path composed of
Bézier curve A Bézier curve ( , ) is a parametric equation, parametric curve used in computer graphics and related fields. A set of discrete "control points" defines a smooth, continuous curve by means of a formula. Usually the curve is intended to approxima ...
s. It is similar to a
polygon In geometry, a polygon () is a plane figure made up of line segments connected to form a closed polygonal chain. The segments of a closed polygonal chain are called its '' edges'' or ''sides''. The points where two edges meet are the polygon ...
in that it connects a set of vertices by lines, but whereas in polygons the vertices are connected by straight lines, in a béziergon 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 PostScript (PS) is a page description language and dynamically typed, stack-based programming language. It is most commonly used in the electronic publishing and desktop publishing realm, but as a Turing complete programming language, it c ...
or
PDF Portable document format (PDF), standardized as ISO 32000, is a file format developed by Adobe Inc., Adobe in 1992 to present documents, including text formatting and images, in a manner independent of application software, computer hardware, ...
file. Such outlines are composed of one béziergon for open letters, or multiple béziergons for closed letters. Modern
vector graphics Vector graphics are 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 displ ...
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 printi ...
systems like
PostScript PostScript (PS) is a page description language and dynamically typed, stack-based programming language. It is most commonly used in the electronic publishing and desktop publishing realm, but as a Turing complete programming language, it c ...
,
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 contexts, ...
,
Metafont Metafont is a page description language, description language used to define raster fonts. It is also the name of the interpreter (computer software), interpreter that executes Metafont code, generating the bitmap fonts that can be embedded into ...
,
OpenType OpenType is a format for scalable computer fonts. Derived from TrueType, it retains TrueType's basic structure but adds many intricate data structures for describing typographic behavior. OpenType is a registered trademark of Microsoft Corpora ...
, 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 Point (geometry), points is the property of their lying on a single Line (geometry), line. A set of points with this property is said to be collinear (sometimes spelled as colinear). In greater generality, t ...
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 In numerical analysis, a B-spline (short for basis spline) is a type of Spline (mathematics), spline function designed to have minimal Support (mathematics), support (overlap) for a given Degree of a polynomial, degree, smoothness, and set of bre ...
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 curve A Bézier curve ( , ) is a parametric equation, parametric curve used in computer graphics and related fields. A set of discrete "control points" defines a smooth, continuous curve by means of a formula. Usually the curve is intended to approxima ...
s. 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, 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. Some typefaces render it as a small line, slightly curved or straight, but inclined from the vertical; others give it the appearance of a miniature fille ...
\\ \mathbf & = mathbf, 1\\ \mathbf & = , \mathbf\\ \mathbf & =
, 0 The comma is a punctuation mark that appears in several variants in different languages. Some typefaces render it as a small line, slightly curved or straight, but inclined from the vertical; others give it the appearance of a miniature fille ...
\\ \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 approximate 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 polybézier (red) approximating a circle (black) with control points File:Circle and cubic bezier.svg, Four-segment cubic polybézier (red) approximating a circle (black) with control points


Fonts

TrueType TrueType is an Computer font#Outline fonts, outline font standardization, standard developed by Apple Inc., Apple in the late 1980s as a competitor to Adobe Inc., Adobe's PostScript fonts#Type 1, Type 1 fonts used in PostScript. It has become the ...
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 printi ...
to any given accuracy, 3rd order Béziers require less data than 2nd order Béziers; 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 In numerical analysis, a B-spline (short for basis spline) is a type of Spline (mathematics), spline function designed to have minimal Support (mathematics), support (overlap) for a given Degree of a polynomial, degree, smoothness, and set of bre ...
*
Confluent hypergeometric function In mathematics, a confluent hypergeometric function is a solution of a confluent hypergeometric equation, which is a degenerate form of a hypergeometric differential equation where two of the three regular singularities merge into an irregular s ...


References

{{DEFAULTSORT:Bezier Spline Splines (mathematics)