The Essentials of CAGD

Similar documents
Bernstein polynomials of degree N are defined by

Curves, Surfaces and Segments, Patches

1.1. The analytical denition. Denition. The Bernstein polynomials of degree n are dened analytically:

CMSC427 Parametric curves: Hermite, Catmull-Rom, Bezier

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

Bézier Curves and Splines

Interpolation and polynomial approximation Interpolation

MA 323 Geometric Modelling Course Notes: Day 12 de Casteljau s Algorithm and Subdivision

Home Page. Title Page. Contents. Bezier Curves. Milind Sohoni sohoni. Page 1 of 27. Go Back. Full Screen. Close.

Introduction to Computer Graphics. Modeling (1) April 13, 2017 Kenshi Takayama

On-Line Geometric Modeling Notes

Introduction to Curves. Modelling. 3D Models. Points. Lines. Polygons Defined by a sequence of lines Defined by a list of ordered points

Practical Linear Algebra: A Geometry Toolbox

Arsène Pérard-Gayot (Slides by Piotr Danilewski)

Subdivision Matrices and Iterated Function Systems for Parametric Interval Bezier Curves

A Relationship Between Minimum Bending Energy and Degree Elevation for Bézier Curves

M2R IVR, October 12th Mathematical tools 1 - Session 2

Smooth Path Generation Based on Bézier Curves for Autonomous Vehicles

MA 323 Geometric Modelling Course Notes: Day 11 Barycentric Coordinates and de Casteljau s algorithm

Approximation of Circular Arcs by Parametric Polynomials

MAT300/500 Programming Project Spring 2019

Sample Exam 1 KEY NAME: 1. CS 557 Sample Exam 1 KEY. These are some sample problems taken from exams in previous years. roughly ten questions.

Lecture 20: Bezier Curves & Splines

Lecture 23: Hermite and Bezier Curves

Computing roots of polynomials by quadratic clipping

MA 323 Geometric Modelling Course Notes: Day 07 Parabolic Arcs

Curves. Hakan Bilen University of Edinburgh. Computer Graphics Fall Some slides are courtesy of Steve Marschner and Taku Komura

Practical Linear Algebra: A Geometry Toolbox

CSE 167: Lecture 11: Bézier Curves. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012

Reading. w Foley, Section 11.2 Optional

Novel polynomial Bernstein bases and Bézier curves based on a general notion of polynomial blossoming

Practical Linear Algebra: A Geometry Toolbox

Continuous Curvature Path Generation Based on Bézier Curves for Autonomous Vehicles

Approximation of Circular Arcs by Parametric Polynomial Curves

Cubic Splines; Bézier Curves

CGT 511. Curves. Curves. Curves. What is a curve? 2) A continuous map of a 1D space to an nd space

Mathematical Principles for Scientific Computing and Visualization

Interpolation and Deformations A short cookbook

Chapter 3-1 Polynomials

Pythagorean-hodograph curves

Katholieke Universiteit Leuven Department of Computer Science

Matrix Methods for the Bernstein Form and Their Application in Global Optimization

Lagrange Interpolation and Neville s Algorithm. Ron Goldman Department of Computer Science Rice University

GEOMETRIC MODELLING WITH BETA-FUNCTION B-SPLINES, I: PARAMETRIC CURVES

22m:033 Notes: 1.8 Linear Transformations

EXPLICIT ERROR BOUND FOR QUADRATIC SPLINE APPROXIMATION OF CUBIC SPLINE

MCR3U Unit 7 Lesson Notes

MATH Max-min Theory Fall 2016

Outline. 1 Interpolation. 2 Polynomial Interpolation. 3 Piecewise Polynomial Interpolation

Weighted G 1 -Multi-Degree Reduction of Bézier Curves

Fitting a Natural Spline to Samples of the Form (t, f(t))

After linear functions, the next simplest functions are polynomials. Examples are

A monomial is measured by its degree To find its degree, we add up the exponents of all the variables of the monomial.

Computing roots of polynomials by quadratic clipping

MAT 300 Midterm Exam Summer 2017

Scientific Computing: An Introductory Survey

9-12 Mathematics Vertical Alignment ( )

Geometric meanings of the parameters on rational conic segments

An O(h 2n ) Hermite approximation for conic sections

Nonlinear Means in Geometric Modeling

Inverses. Stephen Boyd. EE103 Stanford University. October 28, 2017

Lecture Note 3: Interpolation and Polynomial Approximation. Xiaoqun Zhang Shanghai Jiao Tong University

Interpolation and Deformations A short cookbook

Curvature variation minimizing cubic Hermite interpolants

ANALYTICAL MATHEMATICS FOR APPLICATIONS 2018 LECTURE NOTES 3

Geometric Lagrange Interpolation by Planar Cubic Pythagorean-hodograph Curves

( ) is called the dependent variable because its

Lectures 9-10: Polynomial and piecewise polynomial interpolation

In practice one often meets a situation where the function of interest, f(x), is only represented by a discrete set of tabulated points,

Algebraic Geometry for CAGD

2 The De Casteljau algorithm revisited

Something that can have different values at different times. A variable is usually represented by a letter in algebraic expressions.

TEKS: 2A.10F. Terms. Functions Equations Inequalities Linear Domain Factor

3. Numerical integration

polynomial function polynomial function of degree n leading coefficient leading-term test quartic function turning point

Ma/CS 6a Class 24: More Generating Functions

The Algebra and Geometry of Curve and Surface Inversion

arxiv: v4 [cs.gr] 23 Nov 2015

Calculating determinants for larger matrices

1 f(u)b n i (u)du, (1.1)

arxiv: v1 [math.na] 22 Jun 2010

Module 11 Lesson 3. Polynomial Functions Quiz. Some questions are doubled up if a pool wants to be set up to randomize the questions.

Fitting Linear Statistical Models to Data by Least Squares: Introduction

UNIT 2 FACTORING. M2 Ch 11 all

and let s calculate the image of some vectors under the transformation T.

Algebra II Vocabulary Alphabetical Listing. Absolute Maximum: The highest point over the entire domain of a function or relation.

n n matrices The system of m linear equations in n variables x 1, x 2,..., x n can be written as a matrix equation by Ax = b, or in full

Note: A file Algebra Unit 09 Practice X Patterns can be useful to prepare students to quickly find sum and product.

Computer Graphics Keyframing and Interpola8on

Visualizing Bezier s curves: some applications of Dynamic System Geogebra

Path Planning based on Bézier Curve for Autonomous Ground Vehicles

Sec 2.1 Operations with Polynomials Polynomial Classification and Operations

Homework 3 Solutions Math 309, Fall 2015

Parametric Equations, Vectors, and Vector Valued Functions. Different parametric equations can yield the same curve:

2-2: Evaluate and Graph Polynomial Functions

Polynomials and Polynomial Equations

Semidefinite Programming

Tennessee s State Mathematics Standards Precalculus

Algebra Review. Finding Zeros (Roots) of Quadratics, Cubics, and Quartics. Kasten, Algebra 2. Algebra Review

Transcription:

The Essentials of CAGD Chapter 4: Bézier Curves: Cubic and Beyond Gerald Farin & Dianne Hansford CRC Press, Taylor & Francis Group, An A K Peters Book www.farinhansford.com/books/essentials-cagd c 2000 Farin & Hansford The Essentials of CAGD 1 / 33

Outline 1 Introduction to Bézier Curves: Cubic and Beyond 2 Bézier Curves 3 Derivatives Revisited 4 The de Casteljau Algorithm Revisited 5 The Matrix Form and Monomials Revisited 6 Degree Elevation 7 Degree Reduction 8 Bézier Curves over General Intervals 9 Functional Bézier Curves 10 More on Bernstein Polynomials Farin & Hansford The Essentials of CAGD 2 / 33

Introduction to Bézier Curves: Cubic and Beyond An excerpt from P. de Casteljau s writings Bézier curves are not restricted to cubics Here we explore these more general curves Farin & Hansford The Essentials of CAGD 3 / 33

Bézier Curves A Bézier curve of degree n x(t) = b 0 B n 0(t)+b 1 B n 1(t)+...+b n B n n(t) B n i (t) are Bernstein polynomials ( ) n Bi n (t) = (1 t) n i t i i B 4 i (t) over [0,1] Binomial coefficients: ( ) n = i { n! i!(n i)! if 0 i n 0 else (1 t) 4 4(1 t) 3 t 6(1 t) 2 t 2 4(1 t)t 3 t 4 Farin & Hansford The Essentials of CAGD 4 / 33

Bézier Curves Several examples of higher degree Bézier curves User might influence the shape by Adding more control points Moving control points Properties from the cubic case carry over Farin & Hansford The Essentials of CAGD 5 / 33

Derivatives Revisited ẋ(t) = n[ b 0 B n 1 0 +...+ b n 1 B n 1 n 1 ] where b i = b i+1 b i A degree n 1 Bézier curve with vector coefficients The k th derivative d k x(t) dt k = n! (n k)! [ k b 0 B n k 0 (t)+...+ k b n k B n k n k (t)] k is the forward difference operator recursively defined by k b i = k 1 b i+1 k 1 b i where 0 b i = b i Examples: k = 2 : b i+2 2b i+1 +b i k = 3 : b i+3 3b i+2 +3b i+1 b i k = 4 : b i+4 4b i+3 +6b i+2 4b i+1 +b i Farin & Hansford The Essentials of CAGD 6 / 33

Derivatives Revisited At the endpoints the derivative calculations simplify (Abbreviated notation for the k th derivative) x (k) (0) = x (k) (1) = n! (n k)! k b 0 n! (n k)! k b n k One nice feature of Bézier curves: Simple geometric interpretation of the first and second derivatives at the endpoints Farin & Hansford The Essentials of CAGD 7 / 33

Derivatives Revisited Example [ ] [ ] x(t) = (1 t) 3 1 +3(1 t) 2 0 t 0 1 ] ] +3(1 t)t 2 [ 0 1 +t 3 [ 1 0 ẍ(0) = 6 2 b 0 = 6(b 2 2b 1 +b 0 ) [ ] 0 ẍ(0) = 6( 1 [ ] 6 = 18 2 [ ] 0 + 1 [ ] 1 ) 0 Farin & Hansford The Essentials of CAGD 8 / 33

The de Casteljau Algorithm Revisited Evaluation of a degree n Bézier curve via the de Casteljau algorithm for r = 1,...,n for i = 0,...,n r b r i (t) = (1 t)br 1 i +tb r 1 i+1 Point on the curve: x(t) = b n 0 (t) Several de Casteljau algorithm evaluations of a degree four Bézier curve Note locus of each b r i (t) Farin & Hansford The Essentials of CAGD 9 / 33

The de Casteljau Algorithm Revisited The de Casteljau algorithm subdivides the curve into a left and a right segment Quintic curve subdivided at t = 3/4 b 0,b 1 0,...,b n 0 b n 0,b n 1 1,...,b n Recall: these are points along diagonal and base of the schematic triangular diagram Farin & Hansford The Essentials of CAGD 10 / 33

The de Casteljau Algorithm Revisited The de Casteljau algorithm provides a way for computing the first derivative ẋ(t) = n[b n 1 1 b n 1 0 ] Difference of the points in the next to last step First derivative of a quartic curve at t = 1/2 Farin & Hansford The Essentials of CAGD 11 / 33

The de Casteljau Algorithm Revisited Second derivative can also be extracted from the de Casteljau algorithm ẍ(t) = n(n 1)[b n 2 2 2b n 2 1 +b n 2 0 ] A scaling of the second difference of the (n 2) nd column in the schematic triangular diagram Farin & Hansford The Essentials of CAGD 12 / 33

The Matrix Form and Monomials Revisited Sometimes convenient to write a Bézier curve in matrix form Generalizing the cubics Define two vectors N and B by B0 n (t) b 0 N =. B =. Bn(t) n then the Bézier curve becomes x(t) = N T B This notation will be useful for dealing with surfaces b n Farin & Hansford The Essentials of CAGD 13 / 33

The Matrix Form and Monomials Revisited Matrix notation useful for converting between the Bernstein and monomial basis functions Recall for cubics: b(t) = [ 1 3 3 1 1 ] b 0 b 1 b 2 b 3 0 3 6 3 t 0 0 3 3 t 2 0 0 0 1 t 3 1 3 3 1 [ ] [ ] a0 a 1 a 2 a 3 = b0 b 1 b 2 b 3 0 3 6 3 0 0 3 3 0 0 0 1 Columns scaled forms of the derivative at t = 0 ( ) n a 0 = b 0 and a i = i b 0 for i = 1...n i Farin & Hansford The Essentials of CAGD 14 / 33

The Matrix Form and Monomials Revisited The Bernstein form is more appealing from a geometric point of view Curve defined by control points which mimic the shape of the curve Monomial form defined in terms of its derivatives Bernstein form numerically more stable than the monomial form Farin & Hansford The Essentials of CAGD 15 / 33

Degree Elevation A degree n polynomial is also one of degree n+1 Leading monomial form coefficient is zero A quadratic Bézier curve to demonstrate x(t) = (1 t) 2 b 0 +2(1 t)tb 1 +t 2 b 2 Trick: multiply the quadratic expression by [t +(1 t)] Results in a cubic curve with control points x(t) = B 3 0b 0 +B 3 1[ 1 3 b 0 + 2 3 b 1]+B 3 2[ 2 3 b 1 + 1 3 b 2]+B 3 3b 2 Trace of the cubic form of curve identical to original quadratic Farin & Hansford The Essentials of CAGD 16 / 33

Degree Elevation Example: Quadratic Bézier curve [ ] [ ] [ ] 0 3 6 b 0 = b 0 1 = b 3 2 = 0 Degree elevation results in x(t) = c 0 B 3 0 +c 1B 3 1 +c 2B 3 2 +c 3B 3 3 Curve drawn incorrectly [ ] 3 Max y-value occurs at 3/2 [ 0 c 0 = b 0 = 0] c 1 = [ 1 3 b 0 + 2 [ 2 3 b 1] = 2] c 2 = [ 2 3 b 1 + 1 [ 4 3 b 2] = 2] [ 6 c 3 = b 2 = 0] Farin & Hansford The Essentials of CAGD 17 / 33

Degree Elevation Degree n Bézier curve with control polygon b 0,...,b n Degree elevate to Bézier curve with control polygon c 0,...,c n+1 c 0 = b 0. c i = i n+1 b i 1 +(1 i n+1 )b i. c n+1 = b n Farin & Hansford The Essentials of CAGD 18 / 33

Degree Elevation Written as a matrix operation 1 Abbreviated: Example: DB = C.. 1 b 0. = b n D is (n+2) (n+1) 1 0 0 c 1/3 2/3 0 b 0 0 0 2/3 1/3 b 1 = c 1 c b 2 0 0 1 2 c 3 c 0. c n+1 Farin & Hansford The Essentials of CAGD 19 / 33

Degree Elevation Degree elevation may be applied repeatedly Resulting sequence of control polygons will converge to the curve Convergence is too slow for practical purposes Farin & Hansford The Essentials of CAGD 20 / 33

Degree Reduction Some CAD systems allow up to degree 40 and others use degree 3 only Reducing a degree 40 curve to a cubic is not trivial In practice several degree 3 curves needed Interplay between subdivision and degree reduction Farin & Hansford The Essentials of CAGD 21 / 33

Degree Reduction Must approximate a degree n+1 curve by degree n curve Recall degree elevation 1.. 1 b 0. b n = c 0. c n+1 DB = C Degree reduction: Given C then find B Problem: D not a square matrix cannot invert Solution: multiply both sides by D T D T DB = D T C Farin & Hansford The Essentials of CAGD 22 / 33

Degree Reduction Example: Revisit degree elevation example 1 0 0 1/3 2/3 0 b 0 0 2/3 1/3 b 1 = b 0 0 1 2 c 0 c 1 c 2 c 3 D T D = 1 10 2 0 2 8 2 D T C = 1 2 2 12 8 9 3 0 2 10 22 2 First column of D T C corresponds to the x components Second column corresponds to the y components x and y sent separately to linear system solver 0 0 B = 3 3 b 0 = 6 0 [ ] 0 0 b 1 = [ ] 3 3 b 2 = [ ] 6 0 Farin & Hansford The Essentials of CAGD 23 / 33

Degree Reduction Degree reduction via solution to D T DB = D T C In general will not pass through the original curve endpoints c 0 and c n+1 Could be enforced after solving the linear system endpoint interpolation In the example above: Automatic because the cubic was a degree elevated quadratic! Farin & Hansford The Essentials of CAGD 24 / 33

Bézier Curves over General Intervals Associate a Bézier curve with the parameter interval [a,b] rather than [0,1] Let u be the global parameter associated with [a,b] Parameter transformation Local parameter t t = u a b a Local parameter needed for de Casteljau algorithm evaluation Obtain the curve segment that runs from b 0 to b n Trace of Bézier curve same regardless of the parameter interval associated with it Plugging global parameter into the de Casteljau algorithm results in extrapolation Farin & Hansford The Essentials of CAGD 25 / 33

Functional Bézier Curves Recall graphs of functions versus parametric curves in Chapter 3 Parametric curve is more general than a functional curve Graph of a functional curve can be thought of as a parametric curve [ ] x y = [ ] x(t) y(t) = [ ] t g(t) One dimension restricted to be a linear polynomial Another name for a functional curve: nonparametric curve Farin & Hansford The Essentials of CAGD 26 / 33

Functional Bézier Curves Write a (polynomial) functional curve in Bézier form For now: t [0,1] b i are scalar values: Bézier ordinates g(t) = b 0 B n 0 +...+b n B n n Remains to write the linear polynomial t as a degree n polynomial Match the degree of g(t) Farin & Hansford The Essentials of CAGD 27 / 33

Functional Bézier Curves Bézier curves have linear precision Degree n linear interpolant requires evenly spaced control points Abscissa values evenly spaced [ 0 b(t) = B n b0] 0 +... [ ] j/n + B b j n +... j [ 1 + B bn] n n Function with t [a,b] abscissa values (b a) a+j n j = 0,...,n Farin & Hansford The Essentials of CAGD 28 / 33

More on Bernstein Polynomials Quadratic Bernstein polynomials (See earlier slide for degree 4 figure) Look a little closer at B n i to understand the behavior of Bézier curves de Casteljau algorithm generally preferred for the evaluation To plot the Bernstein polynomials: Note they are functions Formulate them as Bézier curves Farin & Hansford The Essentials of CAGD 29 / 33

More on Bernstein Polynomials The binomial coefficients ( n i) look complicated Pascal s triangle 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 Each element in a row generated by adding the two elements in the previous row that lie above the element For degree n: take from the (n+1) st row B 4 i : (1 t) 4 4(1 t) 3 t 6(1 t) 2 t 2 4(1 t)t 3 t 4 Farin & Hansford The Essentials of CAGD 30 / 33

More on Bernstein Polynomials The Bernstein polynomials also called Bernstein basis functions Monomials are another example of basis functions A set of polynomials of degree n that form a basis allow you to write any polynomial of degree less than or equal to n in terms of a unique combination of the basis functions Farin & Hansford The Essentials of CAGD 31 / 33

More on Bernstein Polynomials Partition of unity property: For any particular value of t B n 0 (t)+...+bn n (t) = 1 Useful identity to keep in mind when debugging a program! Each Bernstein polynomial is nonnegative within the interval [0, 1] Nonnegative property and partition of unity property Bézier curves have the convex hull property Farin & Hansford The Essentials of CAGD 32 / 33

More on Bernstein Polynomials Symmetry in the Bernstein polynomials: B n i (t) = Bn n i (1 t) Bézier curves have the symmetry property Bézier points numbered from left to right or right to left Same curve geometry Farin & Hansford The Essentials of CAGD 33 / 33