Dr. Regalla Srinivasa Prakash

I/C, Regalla Srinivasa Prakash 1

Bezier Curves
• A
i t – Adds
Add flexibility
fl ibilit and d intuitive
i t iti f l in
feel i
mechanical design
• Credited to P. Bezier; P. De Casteljau also developed
• Only control points (not necessarily only 2 per segment)
form the
h input,
i no specification
ifi i off tangent vectors –
provides more direct relation between input (points) and
p ((curve))
• The order of the Bezier is variable (unlike HCC) and
depends on the number of control points, (n+1)
• (n+1) number of control points define an nthh degree
curve (we will term degree of curve as (k-1)
• Bezier curve can be smoother than HCC
I/C, Regalla Srinivasa Prakash 2

• The Bezier curve is defined in terms of (n+1)
control points,
points called as control points
• These control points form the vertices of the
control or Bezier characteristic polygon
• The control or Bezier characteristic polygon
uniquely defines the curve

I/C, Regalla Srinivasa Prakash 3

• The curve shape tends to follow the
polygon shape and thus easy to guess
and sketch

• Order of the control points is very essential
because changing the order can change
the shape of the curve

I/C, Regalla Srinivasa Prakash 4

Bezier Curve • The user supplies ((n+1)) control points.n (u ) 0 ≤ u ≤1 i =0 ⎛n⎞ i Bi . Pi • Write the curve as: n P(u ) = ∑ Pi Bi . i ) = ⎝i⎠ i!(n − i )! I/C. Regalla Srinivasa Prakash 5 .n (u ) = C ⎜⎜ ⎟⎟u (1 − u ) n −i ⎝i⎠ where the binomial coefficient ⎛n⎞ n! C ⎜⎜ ⎟⎟ or C (n.

. ) ( . ) P(u ) = Po (1 − u ) n + P1C (n.u )3 + P1 * 3 * u * ( 1 .n are the Bernstein polynomials p y of degree g ((k-1)=n ) • We can write the complete form of Bezier curve while observing g that C(n. + Pn−1C (n..u )2 + P2 * 3 * u2 * ( 1 .u ) + P2 u2 Special case. • The functions Bi.0)=C(n.u ) 2 + P1 * 2 * u ( 1 . 4 control points B(u) = P0 * ( 1 . Regalla Srinivasa Prakash 6 .1)u (1 − u ) n −1 + P2C (n. case 3 control points B(u) = P0 * ( 1 . n − 1)u n −1 (1 − u ) + Pnu n 0 ≤ u ≤1 Special case.u ) + P3 * u3 I/C.2)u 2 (1 − u ) n − 2 + .n)=1 ( .

1)u (1 − u ) n −1 + P2C (n.2)u 2 (1 − u ) n − 2 + . + Pn−1C (n. Regalla Srinivasa Prakash 7 .. i ) Pn −i (n − r )! i =0=0 I/C. i ) Pi (n − r )! i =0 r Pr (u = 1) = n! ∑ (− 1)i C (r .P(u ) = Po (1 − u ) n + P1C (n.. n − 1)u n −1 (1 − u ) + Pnu n 0 ≤ u ≤1 • Substitute u=0 and u=1.…? • The curve is tangent to the first and last segments of control polygonal segments proof? segments…proof? • Deriving the parametric form “r” times r Pr (u = 0) = n! ∑ (− 1)r −i C (r .

8 B0 B1 0. Regalla Srinivasa Prakash 8 .Bezier Basis Functions for (n+1)=4 (n 1) 4 1.2 1 0.2 0 I/C.4 0 B3 0.6 B2 0.

Some Bezier Curves What did you observe? → I/C. Regalla Srinivasa Prakash 9 .

points • It passes through Po and Pn if we substitute u=0 and u=1 I/C. Characteristics of Bezier Curve 1) The curve interpolates the first and last control points. Regalla Srinivasa Prakash 10 .

i ) Pi (n − r )! i =0 r Pr (u = 1) = n! ∑ (− 1)i C (r . Regalla Srinivasa Prakash 11 . the first derivatives at the endpoints are P' (u = 0) = n(P1 −Po ) P' (u = 1) = n(Pn − Pn−1 ) • Can you find the second derivative at P0? What do you observe? Ans: It is determined by y Po. the rth derivative at an endpoint is determined by its “r” neighbouring control points. I/C. P1 and P2.. i ) Pn −i (n − r )! i =0 Substituting r = 1. In g general. 2) The curve is tangent to the first and last g curve segments of the control p polygon. yg n! r P (u = 0) = r ∑ (− 1)r −i C (r .

To check this property substitute 1-u = v. Regalla Srinivasa Prakash 12 .n(u). C(n i) = C(n.n(u) ≠ Bn-i. C(n n-i) n i) • Which makes Bi. Be careful. which in turn is due to the property of the binomial functions: C(n. • That is. Bi. I/C. never.3) The curve is symmetric with respect to u and (1 ) (1-u).n(u) to be symmetric when plotted with respect to u.n(u) and Bn-i.5. y • The symmetry y of the Bezier curve is due to the symmetry (NOT equality) of the Bernstein basis. except at u=0. reversing the direction of parametrization does not change the curve shape.

P2 and P3. where ((n+1)) are the total control points. For example in a cubic Bezier curve defined f by Po. 1/3 2/3 and d 1. Regalla Srinivasa Prakash 13 . 1 I/C.n/du = 0 This means that each ith control p point is most influential on the shape of the curve at u=i/n. these points are most i fl influential i l at u=0.n has a maximum value of C(n. 0 1/3.i)(i/n)i(1 – i/n)n-i occuring at u=i/n This can be obtained by setting dBi.. P1.4) The polynomial Bi.

„ By moving a control point „ By providing multiple control points at a vertex of control polygon.5) The shape of the curve (for a given set of control vertices) can be changed by two methods. Regalla Srinivasa Prakash 14 . Multiple control K=3 points are K=2 specified K=1 K 1 here I/C. Multiplicity of control points makes the curve pulled towards that point.

Regalla Srinivasa Prakash 15 . Will the degree of the curve change? By making the last point co- incide with the first point By adding additional control point at the first point I/C.6) A closed Bezier curve can be obtained by making Po and Pn coincident.

for any degree of given curve: n ∑B i =0 i .7) Partition of Unity Property: For any valid value of u. Regalla Srinivasa Prakash 16 .n =1 This provides for * invariance of Bezier curve (or invariance of the relationship between the Bezier curve and its control polygon) l ) under d affine ffi transformations. t f ti p * Method to check numerical computation and software developments. I/C.

each Bernstein polynomial satisfies Bi . u I/C.n > 0 This ensures that the Bezier curve lies entirely e e y in its s co convex e hull. Regalla Srinivasa Prakash 17 .8) Positivity: For any value of u. given any degree of curve.

• The Bezier curve defined with Bernstein polynomial basis possesses the convex h ll property hull t I/C. Regalla Srinivasa Prakash 18 . The Convex Hull Property of B i C Bezier Curve • A curve is said to have convex hull property if it entirely lies in its convex hull defined by its control polygon.

Regalla Srinivasa Prakash 19 . Example p –1 Convex Hull Example p –2 Degree = 3 (Hatched region) Degree = 3 I/C. How to get the Convex Hull of a B i curve? Bezier ? • The convex hull of a Bezier curve is the maximum area obtained by joining all control p points to all control p points.

Convex Hull (Hatched region) Example – 3 Degree = ? Example – 4 Degree = ? I/C. Regalla Srinivasa Prakash 20 .

Consequences q of Convex Hull Property p y There are three important aspects: 1) Degeneration to a straight line: useful 2) Clipping like manipulations become easy 3) Wild oscillations ill ti off the th curve about b t any control point is avoided I/C. Regalla Srinivasa Prakash 21 .

Repeated Slide Consequences of Convex Hull Property • There are three important aspects: 1) If the control polygon degenerates to a straight line. the curve segment also should become straight g line. 2) Clipping like manipulations need to clip only the control polygon not the actual curve. thus saving in computational time. I/C. Regalla Srinivasa Prakash 22 . 3) Wild oscillations of the curve about any control point is avoided. This is a useful design g feature and is assured by convex hull property.

the joining point and the second point of the second segment be collinear. collinear • Now: (n+1) = Number of the control points of the first segment (m+1) = Number of the control points of the second segment Equatingg the tangent g vectors ((a sufficient condition)) {n(Pn – Pn-1)}first segment = {m(P1 – Po)}second segment {(Pn – Pnn-11)}first segment = ((m/n){(P {( ){( 1 – Po)}second segment I/C. • For C1 continuity:y The end slope p of the first segment g need to be equal to the starting slope of the second segment.Composite Bezier Curves: Blending • For Co continuity: y the last control of the first Bezier curve segment be coincided with the first point of the second Bezier curve segment. Regalla Srinivasa Prakash 23 . This requires that the (n-1)th point of the first segment.

P5. P7 and P8. then P2. P2 and P3 and second segment is formed by P4. P6. Therefore f (P3 – P2)= (4/3)(P5 – P4) P7 P2 P1 P4 P8 P3 P P5 P6 o I/C. Example • If the first segment is formed by Po. P3 (coinciding with P4) and P5 must be collinear. Regalla Srinivasa Prakash 24 . P1.

M123 .5 to the point with u=1 I/C. Call them M012. Regalla Srinivasa Prakash 25 . M23 • Step 2: Find the midpoints of the lines joining M01. M123. Call them M01. Sub-Dividing Bezier Curves de Casteljau’s Casteljau s Algorithm • Step 1: Find the midpoints of the lines joining the original g control vertices. M12. M23 and P3 exactly follows the original curve from the point with u=0. M012 and M0123 exactly follows the original curve from the point with u=0 to the point with u=0. M01. M12 and M12. M23. Call it M0123 • The curve with control p points P0. M123 • Step St 3: 3 Find Fi d the th midpoint id i t off the th line li joining j i i M012.5 • The curve with control points M0123 .

Regalla Srinivasa Prakash 26 . Sub-Dividing Sub Dividing Bezier Curves M12 P1 P2 M012 M0123 M123 M01 M23 P0 P3 I/C.

Sub-Dividing Sub Dividing Bezier Curves P1 P2 P0 P3 I/C. Regalla Srinivasa Prakash 27 .

Regalla Srinivasa Prakash 28 .25. de Casteljau’s Algorithm • You can find the point on a Bezier curve for any parameter value u with a similar algorithm • Say you want u=0.25 M01 P0 P3 I/C. u=0 25 instead of taking midpoints take points 0.25 of the way M12 P1 P2 M23 t=0.

• Bit questions I/C. Regalla Srinivasa Prakash 29 .

Pierre Bézier. Regalla Srinivasa Prakash 30 .• Who invented Bezier curve? • Bézier curve is attributed and named after a French engineer. I/C. who used them for the body design of the Renault car in the 1970's.

d t I/C.• What are the applications of Bezier curve curve. past and present? • They have since obtained dominance in th typesetting the t tti industry i d t and d iin particular ti l with the Adobe Postscript and font products. Regalla Srinivasa Prakash 31 .

. th P(u) then P( ) = P0 for f allll u.e. n=0.• If only one control point is given. Regalla Srinivasa Prakash 32 . I/C. i. given what will be the Bezier curve? If there is only one control point P0.

1 P(u ) = ∑ Pi Bi .. then the formula reduces to a line segment between the two control points. Regalla Srinivasa Prakash 33 .1 (u ) + P1B1.1 (u ) =P0 B0.• If there are only two control points P0 and P1. n=1.1 (u ) i =0 = Po (1 − u ) + P1u = Po + u (P1 − Po ) 0 ≤ u ≤1 I/C.e. what will be the nature of Bezier curve? i.

I/C.• Prove that the Bezier curve with Bernstein polynomials in general does not pass g any through y of the control points except the first and last. Solution: From the formula P(0) = P0 and P(1) = Pn. Regalla Srinivasa Prakash 34 .

Regalla Srinivasa Prakash 35 . Solution: Positivity property. I/C.• Prove that the curve is always contained within the convex hull of the control points and that it never oscillates wildly away from the control points.

First order continuity can be achieved by ensuring the tangent between the first two points and the last two points are the same.• How do you obtain the closed Bezier curve? What is the effect on the degree of the curve? Solution: Closed curves can be generated by making the last control point the same as the first control point. Regalla Srinivasa Prakash 36 . I/C.

I/C. Regalla Srinivasa Prakash 37 .• What is meant by multiplicity of control points and what is the consequence of it? Will multiple control points at a coordinate di l location i change h the h degree d off the h curve? ? Solution: Adding multiple control points at a single position in space will add more weight to that point "pulling" the Bézier curve towards it.

It is also possible to g match the first derivative since the tangent at the ends is alongg the line between the two points at the end. Of course since the curve starts and ends at the first and last control point it is easy to physically match the sections.• Why it is necessary to blend multiple Bezier curve segments to model a part represented by a set of data points. normally y changing the position of one control point will affect the whole curve. This also helpsp control local conditions. I/C. instead of building g curve? a single Solution: As the number of control points increases it is necessary to have higher order polynomials and possibly higher factorials. It is common therefore to piece together small sections of Bézier curves to form a g longer curve. Regalla Srinivasa Prakash 38 .

Second order continuity is generally not possible. Regalla Srinivasa Prakash 39 . ibl I/C.• Does Bezier curve provide C2 continuity at the blend point? Solution.

• Is it possible to build two parallel Bezier curves? Solution: Except for the redundant cases of 2 control points (straight line). Regalla Srinivasa Prakash 40 . it is generally not possible to derive a Bézier curve that is parallel to another Bézier curve. I/C. except in the trivial cases of coincident parallel curves or straight line Bézier curves. It isn't possible to create a Bézier curve that is parallel to another.

Regalla Srinivasa Prakash 41 .• Can a circle be exactly represented by a Bezier curve? Solution: A circle cannot be exactly represented with a Bézier Bé i curve. I/C.

in particular it is possible to create a similar curve except that it passes through the control points. Regalla Srinivasa Prakash 42 .• What are the advantages of Bezier curve? Is it possible to build interpolating Bezier curve? S l ti Solution: Bézier curves have wide applications because they are easy to compute and very stable. There are similar formulations which are also called Bézier curves which behave differently. I/C.

Regalla Srinivasa Prakash 43 Courtesy: http://astronomy.How the degree of Bezier curve is decided? Is the curve ever symmetric? Soution: The degree of the curve is one less than the number of control points. I/C. so it is a quadratic for 3 control It will always be symmetric for a symmetric control point .

What is the advantage of tangency of Bezier curve to the first and last control polygonal segments? • Th The curve always l passes through the end points and is tangent to the line between the last two and first two control points. Regalla Srinivasa Prakash 44 . I/C. points This permits ready piecing p Bézier curves of multiple together with first order continuity.

erratically I/ . points Thus the curve is always "well behaved" and does not oscillating erratically.What is meant by the curve “well behaving”? • The curve always lies within the convex hull of the control points. Regalla Srinivasa Prakash 45 Courtesy: http://astronomy.swin.

Regalla Srinivasa Prakash 46 .eexactly act y one less than the number of control points. Bezier curve is practically impossible because the degree deg ee o of tthe e cu curve e has as to be very e y high. • There is no local control control. it will only be local control over the entire portion the curve curve. Bezier curve can not provide that feature.What are the limitations of Bezier Curve? Solution: • When interpolation is required. Moreover. only global control is available • When a large g number of control p points are to be modeled by a single curve segment. I/C. g .

rational splines. Regalla Srinivasa Prakash 47 . Hermite curves and everything else we will study are translation and rotation invariant • Some forms of curves. are also perspective invariant – Can do perspective transform of control points and then evaluate the curve I/C.What is invariance of Bezier curve? • Translational invariance means that translating the control points and then evaluating the curve is the same as evaluating and then t translating l ti th the curve • Rotational invariance means that rotating the control points and then evaluating the curve is the same as evaluating and then rotating the curve • These properties are essential for parametric curves used in graphics • It is easy to prove that Bezier curves.