Interactive Graphics. Lecture 9: Introduction to Spline Curves. Interactive Graphics Lecture 9: Slide 1

Similar documents
Lecture 9: Introduction to Spline Curves

In this course we will need a set of techniques to represent curves and surfaces in 2-d and 3-d. Some reasons for this include

Design considerations

Information Coding / Computer Graphics, ISY, LiTH. Splines

Lecture IV Bézier Curves

08 - Designing Approximating Curves

CS130 : Computer Graphics Curves (cont.) Tamar Shinar Computer Science & Engineering UC Riverside

Curves. Computer Graphics CSE 167 Lecture 11

A MATRIX FORMULATION OF THE CUBIC BÉZIER CURVE

Sung-Eui Yoon ( 윤성의 )

Parametric Curves. University of Texas at Austin CS384G - Computer Graphics

Parametric Curves. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

CSE 167: Introduction to Computer Graphics Lecture #11: Bezier Curves. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2016

Remark. Jacobs University Visualization and Computer Graphics Lab : ESM4A - Numerical Methods 331

3D Modeling Parametric Curves & Surfaces. Shandong University Spring 2013

2D Spline Curves. CS 4620 Lecture 13

OUTLINE. Quadratic Bezier Curves Cubic Bezier Curves

CSE 167: Introduction to Computer Graphics Lecture 12: Bézier Curves. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013

CSE 167: Introduction to Computer Graphics Lecture #13: Curves. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2017

An introduction to interpolation and splines

Computer Graphics Curves and Surfaces. Matthias Teschner

GL9: Engineering Communications. GL9: CAD techniques. Curves Surfaces Solids Techniques

Fall CSCI 420: Computer Graphics. 4.2 Splines. Hao Li.

(Spline, Bezier, B-Spline)

Know it. Control points. B Spline surfaces. Implicit surfaces

Computer Graphics. Curves and Surfaces. Hermite/Bezier Curves, (B-)Splines, and NURBS. By Ulf Assarsson

Natural Numbers and Integers. Big Ideas in Numerical Methods. Overflow. Real Numbers 29/07/2011. Taking some ideas from NM course a little further

B-spline Curves. Smoother than other curve forms

LECTURE #6. Geometric Modelling for Engineering Applications. Geometric modeling for engineering applications

Curves and Surfaces for Computer-Aided Geometric Design

COMP3421. Global Lighting Part 2: Radiosity

Splines. Parameterization of a Curve. Curve Representations. Roller coaster. What Do We Need From Curves in Computer Graphics? Modeling Complex Shapes

Section 1.5. Finding Linear Equations

Curves and Surfaces Computer Graphics I Lecture 9

Central issues in modelling

Rational Bezier Curves

2D Spline Curves. CS 4620 Lecture 18

Curves and Surfaces 1

Representing Curves Part II. Foley & Van Dam, Chapter 11

3D Modeling Parametric Curves & Surfaces

Curves and Surfaces Computer Graphics I Lecture 10

TO DUY ANH SHIP CALCULATION

Curve Representation ME761A Instructor in Charge Prof. J. Ramkumar Department of Mechanical Engineering, IIT Kanpur

Rational Bezier Surface

Lecture 2.2 Cubic Splines

Introduction to Computer Graphics

Until now we have worked with flat entities such as lines and flat polygons. Fit well with graphics hardware Mathematically simple

MA 323 Geometric Modelling Course Notes: Day 14 Properties of Bezier Curves

Splines. Connecting the Dots

(Refer Slide Time: 00:02:24 min)

CS348a: Computer Graphics Handout #24 Geometric Modeling Original Handout #20 Stanford University Tuesday, 27 October 1992

Properties of Blending Functions

Computer Graphics CS 543 Lecture 13a Curves, Tesselation/Geometry Shaders & Level of Detail

Rendering Curves and Surfaces. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

ME 261: Numerical Analysis Lecture-12: Numerical Interpolation

Advanced Graphics. Beziers, B-splines, and NURBS. Alex Benton, University of Cambridge Supported in part by Google UK, Ltd

Curve and Surface Basics

CS130 : Computer Graphics Curves. Tamar Shinar Computer Science & Engineering UC Riverside

Computer Graphics. Unit VI: Curves And Fractals. By Vaishali Kolhe

Keyword: Quadratic Bézier Curve, Bisection Algorithm, Biarc, Biarc Method, Hausdorff Distances, Tolerance Band.

Curves and Surfaces. Computer Graphics COMP 770 (236) Spring Instructor: Brandon Lloyd

The goal is the definition of points with numbers and primitives with equations or functions. The definition of points with numbers requires a

Handout 4 - Interpolation Examples

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

Derivative. Bernstein polynomials: Jacobs University Visualization and Computer Graphics Lab : ESM4A - Numerical Methods 313

Parametric curves. Reading. Curves before computers. Mathematical curve representation. CSE 457 Winter Required:

Objects 2: Curves & Splines Christian Miller CS Fall 2011

Spline Notes. Marc Olano University of Maryland, Baltimore County. February 20, 2004

COMPUTER AIDED ENGINEERING DESIGN (BFF2612)

Consider functions such that then satisfies these properties: So is represented by the cubic polynomials on on and on.

Further Graphics. Bezier Curves and Surfaces. Alex Benton, University of Cambridge Supported in part by Google UK, Ltd

Computergrafik. Matthias Zwicker. Herbst 2010

End-Term Examination

CS770/870 Spring 2017 Curve Generation

Curves and Curved Surfaces. Adapted by FFL from CSE167: Computer Graphics Instructor: Ronen Barzel UCSD, Winter 2006

Computational Physics PHYS 420

Natural Quartic Spline

Curves & Surfaces. MIT EECS 6.837, Durand and Cutler

A Practical Review of Uniform B-Splines

Need for Parametric Equations

The Free-form Surface Modelling System

Curve fitting using linear models

Curves and Surface I. Angel Ch.10

Lecture 8. Divided Differences,Least-Squares Approximations. Ceng375 Numerical Computations at December 9, 2010

Lecture 25: Bezier Subdivision. And he took unto him all these, and divided them in the midst, and laid each piece one against another: Genesis 15:10

Intro to Modeling Modeling in 3D

B-Spline Polynomials. B-Spline Polynomials. Uniform Cubic B-Spline Curves CS 460. Computer Graphics

Knot Insertion and Reparametrization of Interval B-spline Curves

ECE 600, Dr. Farag, Summer 09

Les Piegl Wayne Tiller. The NURBS Book. Second Edition with 334 Figures in 578 Parts. A) Springer

OpenGL Graphics System. 2D Graphics Primitives. Drawing 2D Graphics Primitives. 2D Graphics Primitives. Mathematical 2D Primitives.

Interpolation by Spline Functions

Curves D.A. Forsyth, with slides from John Hart

CSC 305 More Modelling

Parametric curves. Brian Curless CSE 457 Spring 2016

An Introduction to B-Spline Curves

To Do. Resources. Algorithm Outline. Simplifications. Advanced Computer Graphics (Spring 2013) Surface Simplification: Goals (Garland)

Developing an Approach to Redesign Freeform Surfaces Using B-Spline Technique

PS Geometric Modeling Homework Assignment Sheet I (Due 20-Oct-2017)

Outline. The de Casteljau Algorithm. Properties of Piecewise Linear Interpolations. Recall: Linear Interpolation

Transcription:

Interactive Graphics Lecture 9: Introduction to Spline Curves Interactive Graphics Lecture 9: Slide 1

Interactive Graphics Lecture 13: Slide 2

Splines The word spline comes from the ship building trade where planks were originally shaped by bending them round pegs fixed in the ground. Originally it was the pegs that were referred to as splines. Now it is the smooth curve that is called a spline. Interactive Graphics Lecture 9: Slide 3

Interpolating Splines Modern splines are smooth curves defined from a small set of points often called knots. In one main class of splines, the curve must pass through each point of the set. These are called interpolating splines Interactive Graphics Lecture 9: Slide 4

Approximating Splines In other cases the curves do not pass through the points. The points act as control points which the user can move to adjust the shape of the curve interactively Interactive Graphics Lecture 9: Slide 5

Non Parametric Spline The simplest splines are just equations in x and y (for two dimensions) The most common is the polynomial spline: y = a 2 x 2 + a 1 x + a 0 given three points we can calculate a 2 a 1 and a 0 Interactive Graphics Lecture 9: Slide 6

A non parametric (parabolic spline) y = a 2 x 2 + a 1 x + a 0 P 0 P 2 P 1 There is no control using non parametric splines. Only one curve (a parabola) fits the data. Interactive Graphics Lecture 9: Slide 7

Parametric Splines If we write our spline in a vector form we get: P = a 2 2 + a 1 + a 0 which has a parameter by convention, as ranges from 0 to 1 the point P traces out a curve. Interactive Graphics Lecture 9: Slide 8

Calculating simple parametric splines We can now solve for the vector constants a 0 a 1 and a 2 as follows. Suppose we want the curve to start at point P 0 P 0 = a 2 2 + a 1 + a 0 we have =0 at the start so P 0 = a 0 Interactive Graphics Lecture 9: Slide 9

Calculating simple parametric splines Suppose we want the spline to end at P 2 we have that at the end = 1 thus P 2 = a 2 2 + a 1 + a 0 = a 2 + a 1 + a 0 = a 2 + a 1 + P 0 Interactive Graphics Lecture 9: Slide 10

Calculating simple parametric splines and in the middle (say = 1/2) we want it to pass through P 1 P 1 = a 2 2 + a 1 + a 0 = a 2 + a 1 + P 0 We have enough equations to solve for a 1 and a 2. Notice that this formulation is the same in 2 and 3 dimensions. Interactive Graphics Lecture 9: Slide 11

Possibilities using parametric splines P 0 P = a 2 2 + a 1 + a 0 P 0 P 2 P 2 P 1 P 1 P 0 P 0 P 2 P 2 P 1 P 1 Interactive Graphics Lecture 9: Slide 12

Higher order parametric splines Parametric polynomial splines must have an order to match the number of knots. 3 knots - quadratic polynomial 4 knots - cubic polynomial etc. Higher order polynomials are undesirable since they tend to oscillate Interactive Graphics Lecture 9: Slide 13

Spline Patches To get round the problem, we can piece together a number of patches, each patch being a parametric spline. Patch 1 Patch 3 Patch 2 Interactive Graphics Lecture 9: Slide 14

Cubic Spline Patches The simplest, and most effective way to calculate parametric spline patches is to use a cubic polynomial. P = a 3 3 + a 2 2 + a 1 + a 0 This allows us to join the patches together smoothly Interactive Graphics Lecture 9: Slide 15

Choosing the gradients Gradient P 1 ' = (P 2 - P 0 )/2 P 3 P 1 P 2 P 2 ' = (P 3 - P 1 )/2 P 0 P = a 3 3 + a 2 2 + a 1 + a 0 Interactive Graphics Lecture 9: Slide 16

Calculating a Cubic Spline Patch P = a 3 3 + a 2 2 + a 1 + a 0 for a patch joining points P i and P i+1 we have =0 at P i and =1 at P i+1 Substituting these values we get P i = a 0 P i+1 = a 3 + a 2 + a 1 + a 0 Interactive Graphics Lecture 9: Slide 17

Calculating a Cubic Spline Patch differentiating P = a 3 3 + a 2 2 + a 1 + a 0 we get P = 3a 3 2 + 2a 2 + a 1 substituting for =0 at P i and =1 at P i+1 we get P' i = a 1 P' i+1 = 3a 3 + 2a 2 + a 1 Interactive Graphics Lecture 9: Slide 18

Calculating a Cubic Spline Patch Putting these four equations into matrix form we get: Interactive Graphics Lecture 9: Slide 19

Calculating a Cubic Spline Patch Finally, inverting the matrix gives us the result we want. Notice that the matrix is the same for every patch Interactive Graphics Lecture 9: Slide 20

Bezier Curves Bezier curves were developed as a method for CAD design. They give very predictable results for small sets of knots, and so are useful as spline patches. The main characteristics of Bezier curves are They interpolate the end points The slope at an end is the same as the line joining the end point to its neighbour Interactive Graphics Lecture 9: Slide 21

A typical Bezier Curve P 1 P 2 P 0 P 3 Interactive Graphics Lecture 9: Slide 22

Casteljau s Algorithm Bezier curves may be computed and visualised using a geometric construction due to Paul de Casteljau. Like a cubic patch, we need a parameter which is to be 0 at the start of the curve, and 1 at the end. A construction can be made for any value of Interactive Graphics Lecture 9: Slide 23

Casteljau s Construction = 0.25 P 0,1 P 1,1 P 0,2 P 2,1 P 2,0 P 3,0 P 1,2 P 1,0 P 0,0 P 0,3 Interactive Graphics Lecture 9: Slide 24

Casteljau s Construction = 0.5 P 0,1 P 1,1 P 0,2 P 1,0 P 2,1 P 2,0 P 3,0 P 1,2 P 0,0 P 0,3 Interactive Graphics Lecture 9: Slide 25

Casteljau s Construction = 0.75 P 0,1 P 1,0 P 1,1 P 2,0 P 0,2 P 3,0 P 2,1 P 1,2 P 0,0 P 0,3 Interactive Graphics Lecture 9: Slide 26

Bernstein Blending Function Splines (including Bezier curves) can be formulated as a blend of the knots. Consider the vector line equation P = (1- )P 0 + P 1 It is a linear blend of two points, and could also be considered the 2 point Bezier curve! Interactive Graphics Lecture 9: Slide 27

Blending Equation Any point on the spline is simply a blend of all the other points. For N+1 knots we have: where W is the Bernstein blending function Interactive Graphics Lecture 9: Slide 28

Expanded Bezier Equations 2 Point: P 0 (1- ) + P 1 3 Point: P 0 (1- ) + 2P 1 (1- ) + P 2 4 Point: P 0 (1- ) + 3P 1 (1- ) + 3P 2 (1- ) + P 3 etc Interactive Graphics Lecture 9: Slide 29

Bezier Curves lack local control Since all the knots of the Bezier curve all appear in the blend they cannot be used for curves with fine detail. However they are very effective as spline patches. Interactive Graphics Lecture 9: Slide 30

Four point Bezier Curves and Cubic Patches Four point Bezier curves are equivalent to cubic patches going through the first and last knot (P0 and P3) It is possible to show their equivalence in two ways: Expanding the iterative blending equation Reversing the de Casteljau algorithm Interactive Graphics Lecture 9: Slide 31

Expanding the blending equation For the case of four knots we can expand the Bernstein blending function to get a polynomial in : This can be multiplied out to give an equation of the form: where: Interactive Graphics Lecture 9: Slide 32

Casteljau s algorithm gives the same result P 0,1 We start from point P 3,0 and express it in terms of its construction line. Then the process is continued. P 1,0 P P 2,0 P 2,1 3,0 P 1,2 P 0,2 P 1,1 P 0,0 P 0,3 Interactive Graphics Lecture 9: Slide 33

Continuing expanding We can drop the first subscript (which indicates the recursion level) to get: which is the same as before Interactive Graphics Lecture 9: Slide 34

Control Points We can summarise the four point Bezier Curve by saying that it has two points that are interpolated and two control points. The curve starts at P 0 and ends at P 3 and its shape can be determined by moving control points (P 1 and P 2 ). This could be done interactively using a mouse. Interactive Graphics Lecture 9: Slide 35

In summary The simplest and most effective way to draw a smooth curve through a set of points is to use a cubic patch. If no interaction is needed setting the gradients by the central difference (P i+1 - P i-1 )/2 is effective. If the user wants to interactively adjust the shape the four point Bezier formulation is ideal Interactive Graphics Lecture 9: Slide 36