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

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

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

CMSC427 Parametric curves: Hermite, Catmull-Rom, Bezier

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

Keyframing. CS 448D: Character Animation Prof. Vladlen Koltun Stanford University

Interpolation and polynomial approximation Interpolation

Approximation of Circular Arcs by Parametric Polynomials

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

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

Bézier Curves and Splines

Animation Curves and Splines 1

Lecture 23: Hermite and Bezier Curves

Curves, Surfaces and Segments, Patches

Reading. w Foley, Section 11.2 Optional

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

The Essentials of CAGD

Computer Graphics Keyframing and Interpola8on

On-Line Geometric Modeling Notes

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

Geometric Interpolation by Planar Cubic Polynomials

Bernstein polynomials of degree N are defined by

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

Numerical Methods I: Interpolation (cont ed)

Interpolation and polynomial approximation Interpolation

Lecture 20: Bezier Curves & Splines

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.

INTERPOLATION. and y i = cos x i, i = 0, 1, 2 This gives us the three points. Now find a quadratic polynomial. p(x) = a 0 + a 1 x + a 2 x 2.

Geometric Lagrange Interpolation by Planar Cubic Pythagorean-hodograph Curves

Chapter 1 Numerical approximation of data : interpolation, least squares method

MA 323 Geometric Modelling Course Notes: Day 07 Parabolic Arcs

CONTROL POLYGONS FOR CUBIC CURVES

Applied Math 205. Full office hour schedule:

G-code and PH curves in CNC Manufacturing

Hermite Interpolation with Euclidean Pythagorean Hodograph Curves

Cubic Splines MATH 375. J. Robert Buchanan. Fall Department of Mathematics. J. Robert Buchanan Cubic Splines

Cubic Splines; Bézier Curves

1 Roots of polynomials

Interpolation Theory

MAT 300 Midterm Exam Summer 2017

Lecture 10 Polynomial interpolation

Planar interpolation with a pair of rational spirals T. N. T. Goodman 1 and D. S. Meek 2

Approximation of Circular Arcs by Parametric Polynomial Curves

Curvature variation minimizing cubic Hermite interpolants

Pythagorean-hodograph curves

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

MA 323 Geometric Modelling Course Notes: Day 20 Curvature and G 2 Bezier splines

Curves - Foundation of Free-form Surfaces

Characterization of Planar Cubic Alternative curve. Perak, M sia. M sia. Penang, M sia.

Geometric meanings of the parameters on rational conic segments

Scientific Computing: An Introductory Survey

Isogeometric Analysis with Geometrically Continuous Functions on Two-Patch Geometries

AFFINE COMBINATIONS, BARYCENTRIC COORDINATES, AND CONVEX COMBINATIONS

Visualizing Bezier s curves: some applications of Dynamic System Geogebra

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

MAT300/500 Programming Project Spring 2019

GENG2140, S2, 2012 Week 7: Curve fitting

Introduction. Introduction (2) Easy Problems for Vectors 7/13/2011. Chapter 4. Vector Tools for Graphics

Scientific Computing

Numerical integration and differentiation. Unit IV. Numerical Integration and Differentiation. Plan of attack. Numerical integration.

Exam 2. Average: 85.6 Median: 87.0 Maximum: Minimum: 55.0 Standard Deviation: Numerical Methods Fall 2011 Lecture 20

Numerical Methods I: Polynomial Interpolation

1 Piecewise Cubic Interpolation

Subdivision Matrices and Iterated Function Systems for Parametric Interval Bezier Curves

3.1 Interpolation and the Lagrange Polynomial

Interpolation and Deformations A short cookbook

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

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

Lösning: Tenta Numerical Analysis för D, L. FMN011,

Lecture 5 3D polygonal modeling Part 1: Vector graphics Yong-Jin Liu.

Quaternion Cubic Spline

13 Path Planning Cubic Path P 2 P 1. θ 2

Polynomials. p n (x) = a n x n + a n 1 x n 1 + a 1 x + a 0, where

Numerical Mathematics & Computing, 7 Ed. 4.1 Interpolation

Computational Physics

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

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

Engineering 7: Introduction to computer programming for scientists and engineers

Computer Aided Design. B-Splines

Spiral spline interpolation to a planar spiral

2 The De Casteljau algorithm revisited

Polynomial approximation and Splines

Interpolation and Deformations A short cookbook

Empirical Models Interpolation Polynomial Models

Introduction. Chapter Points, Vectors and Coordinate Systems

A Variational Model for Data Fitting on Manifolds by Minimizing the Acceleration of a Bézier Curve

Chordal cubic spline interpolation is fourth order accurate

Lectures 9-10: Polynomial and piecewise polynomial interpolation

CHAPTER 4. Interpolation

Data Analysis-I. Interpolation. Soon-Hyung Yook. December 4, Soon-Hyung Yook Data Analysis-I December 4, / 1

Chapter 2 Interpolation

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

Some notes on Chapter 8: Polynomial and Piecewise-polynomial Interpolation

Function Approximation

Geometric Hermite curves with minimum strain energy

19.4 Spline Interpolation

Curve Fitting and Interpolation

CS545 Contents XIII. Trajectory Planning. Reading Assignment for Next Class

Numerical Methods and Computation Prof. S.R.K. Iyengar Department of Mathematics Indian Institute of Technology Delhi

A matrix Method for Interval Hermite Curve Segmentation O. Ismail, Senior Member, IEEE

Transcription:

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

CURVES

Curves Explicit y = f x f: R R γ = x, f x y = 1 x 2 Implicit F x, y = 0 F: R 2 R γ = x, y : F x, y = 0 x 2 + y 2 = 0 Parametric f x t f t f y t f x, f y : R R f: R R 2 typically: t 0,1 γ = x, y : t R: f x t = x f y t = y x t = cos t y t = sin t t 0,2π

Polynomial curves Avoids complicated functions (e.g. pow, exp, sin, sqrt) Use simple polynomials of low degree Flexible, easy to use x t = a 0 + a 1 t + a 2 t 2 + a 3 t 3 + y t = b 0 + b 1 t + b 2 t 2 + b 3 t 3 + z t = c 0 + c 1 t + c 2 t 2 + c 3 t 3 + monomial degree P t = x t y t z t = n i=0 t i a i, b i, c i monomial basis P t = t n t n 1 1 a n b n c n a n 1 b n 1 c n 1 a 0 b 0 c 0 Coefficients R 3 n coordinates each coordinate is R 3

Derivatives angent vector P t = t n t n 1 t 1 a n b n c n a n 1 b n 1 c n 1 a 0 b 0 c 0 P t = nt n 1 n 1 t n 1 1 0 a n b n c n a n 1 b n 1 c n 1 a 0 b 0 c 0

Continuity Continuity and smoothness between parametric curves γ 1, γ 2 : [0,1] R d γ 1 γ 1 γ 2 γ 2 Not continuous G 0 - C 0 -continuous γ 1 1 = γ 2 0

Continuity Continuity and smoothness between parametric curves γ 1, γ 2 : [0,1] R d γ 1 γ 2 γ 2 0 γ 1 1 γ 1 γ 1 1 γ 2 0 γ 2 G 1 -continuous G 0 + tangent vectors parallel γ 1 1 = pγ 2 0, p R + C 1 -continuous C 0 + tangent vectors parallel γ 1 1 = γ 2 0

Continuity Continuity and smoothness between parametric curves γ 1, γ 2 : [0,1] R d G 2 -continuous G 1 + γ 1 1 = pγ 2 0, p R + C 2 -continuous C 1 + γ 1 1 = γ 2 0 G 2 smooth reflections

LAGRANGE INERPOLAION

Lagrange Interpolation Given a set of points: t i, p i, t R, p i R d Find a polynomial P such that: i P t i = p i t 2, p 2 t 1, p 1 t 3, p 3

Lagrange Interpolation Given a set of n points: t i, p i, t R, p i R d Find a polynomial P such that: i P t i = p i For each point associate a Lagrange basis polynomial: t 2, p 2 L i n t = j j i t t j t i t j t 1, p 1 t 3, p 3 t 1, 0 t 3, 0 p 2 L 2 n t (i j) L n i t j = 0 L n i t i = 1

Lagrange Interpolation Given a set of n points: t i, p i, t R, p i R d Find a polynomial P such that: i P t i = p i For each point associate a Lagrange basis polynomial: t 2, p 2 L i n t = j j i t t j t i t j t 1, p 1 t 3, p 3 Add the Lagrange basis with points as weights: P t = i Lagrange basis n n n P t = L 0 L 1 L n 1 L n i t p i p 0 x p 0 y p 0 z p 1 x p 1 y p 1 z p n 1 x p n 1 y p n 1 z

Lagrange Interpolation Given a set of n points: t i, p i, t R, p i R d Find a polynomial P such that: i P t i = p i For each point associate a Lagrange basis polynomial: L i n t = j j i t t j t i t j Add the Lagrange basis with points as weights: Given 2 points L 0 2 t = t t 1 t 0 t 1 L 1 2 t = t t 0 t 1 t 0 P t = linear interpolation Given 3 points L 0 3 t = t t 1 t 0 t 1 t t 2 t 0 t 2 P t = quadratic interpolation P t = i p i L i n t

Problems Problems with a single polynomial Degree depends on the number of interpolation constraints Strong overshooting for high degree (n > 7) Problems with smooth joints Numerically unstable No local changes

SPLINES

Splines Functions for interpolation & approximation Standard curve and surface primitives in geometric modeling Key frame and in-betweens in animations Filtering and reconstruction of images Historically Name for a tool in ship building Flexible metal strip that tries to stay straight Within computer graphics: Piecewise polynomial function P t Q t R t S t

Linear Interpolation - Defined by two points: p 1, p 2 - Searching for P t such that: - P 0 = p 1 - P 1 = p 2 - Degree of P is 1 Basis: 1 t = 1 t 2 t = t 1 1 2 1 t Linear basis P t = p 1 1 t + p 2 2 (t) P t = 1 t t p 1 p 2

Linear Interpolation 0 1 1 1 monomial basis t 1 1 t t Linear basis 1 1 1 0 P t = M 1 1 1 0 p 1 p 2

Linear Interpolation P t = M 1 1 1 0 p 1 p 2 C 0 -continuous

Cubic Hermite Interpolation - Defined by - two points: p 1, p 2 - two tangents: t 1, t 2 - Searching for P t such that: - P 0 = p 1 - P 0 = t 1 - P 1 = t 2 - P 1 = p 2 - Degree of P is 3 Basis: H 0 3 t =? H 1 3 t =? H 2 3 t =? H 3 3 t =?

Cubic Hermite Interpolation - Defined by - two points: p 1, p 2 - two tangents: t 1, t 2 - Searching for P t such that: - P 0 = p 1 - P 0 = t 1 - - P 1 = t 2 P 1 = p 2 t 3 t 2 t 1 - Degree of P is 3 H 1 H 0 3 t H 1 3 t H 2 3 t H 3 3 t Basis: H H 0 3 t =? H 1 3 t =? H 2 3 t =? H 3 3 t =? P t = M H p 1 t 1 t 2 p 2 = M H G

Cubic Hermite Interpolation - Defined by - two points: p 1, p 2 - two tangents: t 1, t 2 - Searching for P t such that: - P 0 = p 1 - P 0 = t 1 - P 1 = t 2 - P 1 = p 2 - Degree of P is 3 P t = t 3 t 2 t 1 1 H G P t = 3t 2 2t 1 0 H G p 1 = P 0 = 0 0 0 1 H G t 1 = P 0 = 0 0 1 0 H G t 2 = P 1 = 3 2 1 0 H G p 2 = P 1 = 1 1 1 1 H G p 1 t 1 t 2 p 2 = 0 0 0 1 0 0 1 0 3 2 1 0 1 1 1 1 H p 1 t 1 t 2 p 2

Cubic Hermite Interpolation - Defined by - two points: p 1, p 2 - two tangents: t 1, t 2 - Searching for P t such that: - P 0 = p 1 - P 0 = t 1 - P 1 = t 2 - P 1 = p 2 - Degree of P is 3 H = 0 0 0 1 0 0 1 0 3 2 1 0 1 1 1 1 1 = 2 1 1 2 3 2 1 3 0 1 0 0 1 0 0 0

Cubic Hermite Interpolation - Defined by - two points: p 1, p 2 - two tangents: t 1, t 2 - Searching for P t such that: - P 0 = p 1 - P 0 = t 1 - P 1 = t 2 - P 1 = p 2 - Degree of P is 3 Basis: H 0 3 t = 1 t 2 (1 + 2t) H 1 3 t = t 1 t 2 H 2 3 t = t 2 t 1 H 3 3 t = 3 2t t 2 H = 2 1 1 2 3 2 1 3 0 1 0 0 1 0 0 0 H 0 3 t H 1 3 t H 2 3 t H 3 3 t H 0 3 H 3 3 H 1 3 H 2 3

Cubic Hermite Interpolation G 1 -continuous C 1 -continuous

Bézier - Defined by - b 0 - start point - b 3 - end point - b 1, b 2 - control points that are approximated - Searching for P t such that: - P 0 = b 0 - P 0 = 3 b 1 b 0 - P 1 = 3 b 3 b 2 - P 1 = b 3 - Degree of P is 3

Bézier - Defined by - b 0 - start point - b 3 - end point - b 1, b 2 - control points that are approximated - Searching for P t such that: - P 0 = b 0 - P 0 = 3 b 1 b 0 - P 1 = 3 b 3 b 2 - P 1 = b 3 - Degree of P is 3 p 1 t 1 t 2 p 2 = 1 0 0 0 3 3 0 0 0 0 3 3 0 0 0 1 b 0 b 1 b 2 b 3 P t = M H BH G

Bézier - Defined by - b 0 - start point - b 3 - end point - b 1, b 2 - control points that are approximated - Searching for P t such that: - P 0 = b 0 - P 0 = 3 b 1 b 0 - P 1 = 3 b 3 b 2 - P 1 = b 3 - Degree of P is 3 Basis: B 3 0 t = 1 t 3 B 3 1 t = 3 1 t 2 t B 3 2 t = 3 1 t t 2 B 3 3 t = t 3 Bernstein polynomial: B n i t = n t i i 1 t n i B = H BH = B 0 3 P t = i B 1 3 1 3 3 1 3 6 3 0 3 3 0 0 1 0 0 0 B 2 3 b i B i n t B 3 3

Bézier properties Advantages: End point interpolation angents explicitly specified Smooth joints are simple P 3, P 4, P 5 collinear G 1 continuous P 5 -P 4 =P 4 -P 3 C 1 continuous Geometric meaning of control points Affine invariance Convex hull property For 0<t<1: B i (t) 0 Symmetry: B i (t) = B n-i (1-t) Disadvantages Smooth joints need to be maintained explicitly Automatic in B-Splines (and NURBS)

DeCasteljau Algorithm Bernstein polynomial defined recursively: P t = b i B i n t B i n t = n i t i 1 t n i = tb n 1 i 1 t + 1 t B n 1 i t i Recursive point computation: b 0 i t = b i b k+1 k i t = tb i+1 t + 1 t b i k t i i i b i k t B i n k t = b k i t tb n k 1 i 1 t + b k i t 1 t B n k 1 i t = k b i+1 t tb i n k 1 t + b i k t 1 t B i n k 1 t = i b i k+1 t B i n k 1 t P t = = b 0 n t

DeCasteljau Algorithm t= 0.5

Catmull-Rom-Splines Goal Smooth (C 1 )-joints between (cubic) spline segments Algorithm angents given by neighboring points P i-1 P i+1 Construct (cubic) Hermite segments Advantage Arbitrary number of control points Interpolation without overshooting Local control

Catmull-Rom-Splines - Each segment defined by - c 1 - start point - c 2 - end point - c 0, c 3 - neighbor segment points - Searching for P t such that: - P 0 = c 1 - P 0 = 1 2 c 2 c 0 - P 1 = 1 2 c 3 c 1 - P 1 = c 2 - Degree of P is 3

Catmull-Rom-Splines - Each segment defined by - c 1 - start point - c 2 - end point - c 0, c 3 - neighbor segment points - Searching for P t such that: - P 0 = c 1 - P 0 = 1 2 c 2 c 0 - P 1 = 1 2 c 3 c 1 - P 1 = c 2 - Degree of P is 3 p 1 t 1 t 2 p 2 = 0 1 0 0 1 1 0 2 2 0 0 1 2 0 1 2 0 0 1 0 c 0 c 1 c 2 c 3 P t = M H CH G

Catmull-Rom-Splines - Each segment defined by - c 1 - start point - c 2 - end point - c 0, c 3 - neighbor segment points - Searching for P t such that: - P 0 = c 1 - P 0 = 1 2 c 2 c 0 - P 1 = 1 2 c 3 c 1 - P 1 = c 2 - Degree of P is 3 Basis: C 0 t = 1 t t 1 2 2 C = H BH = 1 2 1 3 3 1 2 5 4 1 1 0 1 0 0 2 0 0 C 1 t = 1 2 t 1 (3t2 2t 2) C 2 t = 1 2 t 3t2 4t 1 C 3 t = 1 2 t2 t 1

Catmull-Rom-Splines Catmull-Rom-Spline Piecewise polynomial curve Four control points per segment For n control points we obtain (n-3) polynomial segments Application Smooth interpolation of a given sequence of points Key frame animation, camera movement, etc. Control points should be equidistant in time

Choice of Parameterization Problem Often only the control points are given How to obtain a suitable parameterization t i? Example: Chord-Length Parameterization t 0 = 0 t i = j=1 Arbitrary up to a constant factor»warning Distances are not affine invariant! Shape of curves changes under transformations!! i dist P i P i 1

Choice of Parameterization Chord-Length versus uniform Parameterization Analog: hink P(t) as a moving object with mass that may overshoot Uniform Chord-Length