Splines I – Curves and Properties

Slides:



Advertisements
Similar presentations
Computer Graphics: 2D Transformations
Advertisements

© 2008 Pearson Addison Wesley. All rights reserved Chapter Seven Costs.
Copyright © 2003 Pearson Education, Inc. Slide 1 Computer Systems Organization & Architecture Chapters 8-12 John D. Carpinelli.
Chapter 1 The Study of Body Function Image PowerPoint
Finite Element Method CHAPTER 9: FEM FOR 3D SOLIDS
Copyright © 2011, Elsevier Inc. All rights reserved. Chapter 6 Author: Julia Richards and R. Scott Hawley.
Author: Julia Richards and R. Scott Hawley
Properties Use, share, or modify this drill on mathematic properties. There is too much material for a single class, so you’ll have to select for your.
UNITED NATIONS Shipment Details Report – January 2006.
Properties of Real Numbers CommutativeAssociativeDistributive Identity + × Inverse + ×
FACTORING ax2 + bx + c Think “unfoil” Work down, Show all steps.
Points, Vectors, Lines, Spheres and Matrices
SI23 Introduction to Computer Graphics
Visualization Techniques -
Solve Multi-step Equations
REVIEW: Arthropod ID. 1. Name the subphylum. 2. Name the subphylum. 3. Name the order.
Mathematics for Economics Beatrice Venturi 1 Economics Faculty CONTINUOUS TIME: LINEAR DIFFERENTIAL EQUATIONS Economic Applications LESSON 2 prof. Beatrice.
Copyright © Cengage Learning. All rights reserved.
Turing Machines.
EU market situation for eggs and poultry Management Committee 20 October 2011.
Slide 6-1 COMPLEX NUMBERS AND POLAR COORDINATES 8.1 Complex Numbers 8.2 Trigonometric Form for Complex Numbers Chapter 8.
Chapter 2 Complex Numbers
MAT 205 F08 Chapter 12 Complex Numbers.
LIAL HORNSBY SCHNEIDER
14 Vectors in Three-dimensional Space Case Study
Name Convolutional codes Tomashevich Victor. Name- 2 - Introduction Convolutional codes map information to code bits sequentially by convolving a sequence.
Vector-Valued Functions 12 Copyright © Cengage Learning. All rights reserved.
Constant, Linear and Non-Linear Constant, Linear and Non-Linear
Functions, Graphs, and Limits
Basel-ICU-Journal Challenge18/20/ Basel-ICU-Journal Challenge8/20/2014.
1..
CONTROL VISION Set-up. Step 1 Step 2 Step 3 Step 5 Step 4.
© 2012 National Heart Foundation of Australia. Slide 2.
Motion in Two and Three Dimensions
1 Motion and Manipulation Configuration Space. Outline Motion Planning Configuration Space and Free Space Free Space Structure and Complexity.
Surface normals and principal component analysis (PCA)
Splines IV – B-spline Curves
6.4 Best Approximation; Least Squares
Chapter 5 Test Review Sections 5-1 through 5-4.
What You Should Learn • Represent and classify real numbers.
Linear Algebra (Mathematics for CG) Reading: HB Appendix A
Model and Relationships 6 M 1 M M M M M M M M M M M M M M M M
Polynomial Functions of Higher Degree
Chapter 6 Equations 6.1 Solving Trigonometric Equations 6.2 More on Trigonometric Equations 6.3 Trigonometric Equations Involving Multiples Angles 6.4.
Analyzing Genes and Genomes
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
Essential Cell Biology
Intracellular Compartments and Transport
PSSA Preparation.
Essential Cell Biology
Transformations Ed Angel Professor Emeritus of Computer Science
Energy Generation in Mitochondria and Chlorplasts
1 Functions and Applications
1 Dr. Scott Schaefer Least Squares Curves, Rational Representations, Splines and Continuity.
State Variables.
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved.
Dr. S.M. Malaek Assistant: M. Younesi
1 Curves and Surfaces. 2 Representation of Curves & Surfaces Polygon Meshes Parametric Cubic Curves Parametric Bi-Cubic Surfaces Quadric Surfaces Specialized.
Splines II – Interpolating Curves
Curves Locus of a point moving with one degree of freedom
Splines III – Bézier Curves
CS 376 Introduction to Computer Graphics 04 / 23 / 2007 Instructor: Michael Eckmann.
Splines IV – B-spline Curves based on: Michael Gleicher: Curves, chapter 15 in Fundamentals of Computer Graphics, 3 rd ed. (Shirley & Marschner) Slides.
L5 – Curves in GIS NGEN06 & TEK230: Algorithms in Geographical Information Systems by: Sadegh Jamali (source: Lecture notes in GIS, Lars Harrie) 1 L5-
11/6/ :55 Graphics II Introduction to Parametric Curves and Surfaces Session 2.
Splines I – Curves and Properties based on: Michael Gleicher Curves, chapter 15 in Fundamentals of Computer Graphics, 3 rd ed. (Shirley & Marschner) Slides.
CS559 – Curves Lecture These are course notes (not used as slides) Written by Mike Gleicher, Oct Updates Oct 2006, 2007 Updates Oct 2008 © 2005 Michael.
Introduction to Parametric Curve and Surface Modeling.
Introduction to Parametric Curve and Surface Modeling
Presentation transcript:

Splines I – Curves and Properties based on: Michael Gleicher Curves, chapter 15 in Fundamentals of Computer Graphics, 3rd ed. (Shirley & Marschner) Slides by Marc van Kreveld

What is a curve? Intuitively: what you can draw with a pen without lifting it up Mathematically: image of a continuous mapping of an interval into the plane (or higher-d space) f : [0,1]  R2 Image, so the part in R2, continuous, so you cannot lift your pen. The interval can be open or closed. Continuous mapping implies the image is connected [ ]

Types of curves Normal (two endpoints) Closed loops (no endpoints) Infinite curves (no endpoints) When these curves have no self-intersections, the first type does not separate the plane, the second type separates it in a bounded (interior) and unbounded (exterior) part, and the third type separates it in two unbounded parts. In 3D, curves never bound a volume.

More curves Curves may self-intersect, have sharp corners, trace back on themselves, … Well-known curves: line segment, line, circle, ellipse, square (boundary), parabola, circular arc, … General curves are called free-form curves

How to specify a curve (3 ways) Implicit curve Parametric curve Procedurally defined curve

Implicit curves Given by a function in 2 variables (for curves in the plane) and an outcome value of that function Circle with radius 2 centered at origin: x2 + y2 = 4 the function is f(x,y)= x2 + y2 Some weird curve: log x – x2 + y3 = 0 (if this equation yields a connected set???) We can assume the given value is 0 Not every function+value gives a connected set, implying that it cannot be the image of a continuous mapping Think of the image of the 2-value function, which is a surface living in 3D. Setting it equal to a value is intersecting the image with a horizontal plane z=value.

Parametric curves Use a parameter, e.g. t, and use two functions f(t) and g(t) to describe corresponding x and y coordinates f(t) = cos t for t in [0, 2) ; this is a circle g(t) = sin t f(t) = t2 g(t) = t f(t) = t4 g(t) = t2 f(t) = t6 g(t) = t3 What is this second thing? How about the third? And the fourth? What if the first thing has a different t domain?

Parametric curves Representations are not unique The functions f and g can be written together as a vector-valued function f, we then write (x, y) = f(t) as a shorthand for (x, y) = (f(t), g(t))

Procedural curves Defined by a process or a grammar, e.g. Koch snowflake (a fractal curve)

Parametric curves Most common in graphics Easy to work with (we can draw by evaluating at the parameter)

About the parameterization The value of the parameter tells you where you are on the curve The parameter determines “speed” along the curve t=1 t=1 t=1 (0,1) t=½ t=½ t=½ (0,0) (1,0) t=0 t=0 t=0 f(t) = (t, t) f(t) = (t 2, t 2) f(t) = (t 1/2, t 1/2)

About the parameterization Speed is the derivative (magnitude): | d f(t)/d t | t=1 t=1 t=1 (0,1) t=½ t=½ t=½ (0,0) (1,0) t=0 t=0 t=0 f(t) = (t, t) f(t) = (t 2, t 2) f(t) = (t 1/2, t 1/2) speed is 2 everywhere speed increases from 0 to 2 2 speed decreases from  to ½ 2

Arc-length parameterizations Informally, constant-speed parameterizations Formally, when s is used as parameter when it is an arc-length parameterization The squaring in the formula is not needed, it is equivalent if it is not present. However, since f is a vector and pythagoras is needed, and the square-root can be avoided by evaluating the square. f(t) = (t, t)

Arc-length parameterizations Informally, constant-speed parameterizations Formally, when s is used as parameter when it is an arc-length parameterization The squaring in the formula is not needed, it is equivalent if it is not present. However, since f is a vector and pythagoras is needed, and the square-root can be avoided by evaluating the square. f(t) = (t 2, t 2)

Tangent vector along a curve Has a direction and magnitude; the magnitude is speed f(s) = sin s s [0, /2] g(s) = cos s f(t) = t t [0,1] g(t) = ((1 – t)2) For two different parameterizations of the same curve (here: a quarter circle), the direction of the tangent vector will be the same, but the magnitude may different because it depends on the parameterization, not on the curve. The left case is an arc-length parameterization because sin squared + cos squared =1 for any angle. The direction of tangent depends purely on the position on the curve, whereas the magnitude depends on the parameterization as well

Length of a parameterized curve You get the length of a curve by integrating over the magnitude of the tangent vector of the curve The arc length from parameter value a to b, so the arc length between f(a) and f(b), is (x,y) = f(a) (x,y) = f(b)

Piecewise curves f3 f2 f1 f4 Defined by a sequence of functions Should line up head-to-tail to get a continuous overall mapping f3 f2 f1 f4 A piecewise curve is a curve by definition; its description just happens to be done using pieces

Piecewise curves Example f1(t) = (t, 0) for t  [0,1) f2(t) = (t, t – 1) for t  [1,3) f3(t) = (t2 – 2t, t – 1) for t  [3,4]

Piecewise curves Pieces must connect  continuous curve Tangent vector at both sides is the same  differential curve

Types of continuity C0 is the name/notation for normal continuity Parametric continuity C1: The tangent vectors are the same “just before and just after every point on the curve”, in particular for breakpoints Geometric continuity G1: The tangent vector directions are the same just before and just after Parametric continuity depends on the parameterization, while geometric continuity depends only on the shape

Types of continuity You cannot “see” parametric continuity, you need the parameterization Parametric continuity implies geometric continuity Re-parameterization may make a geometrically continuous curve parametrically continuous Cn and Gn means that all derivatives up to (and including) the n-th are continuous Practice: C1 / G1 continuous curves look good, C2 / G2 continuous curves look slightly better, more is not needed

Polynomial pieces Both functions used for the f are polynomials in the parameter Simplest example: piecewise linear (polygonal) curve, consisting of straight line segments; only C0 Each piece can be expressed using linear interpolation between two points: f(u) = (1 – u) p0 + u p1 Also : f(u) = a0 + u a1 (where a0 = p0 and a1 = p1 - p0) p1 u is used as parameter notation when it ranges over the unit interval [0,1] p0

Polynomial pieces Higher-degree polynomials can be written in canonical form: f(u) = a0 + u a1 + u2 a2 (quadratic), or f(u) = a0 + u a1 + u2 a2 + … + un an (n-th degree) In vector/matrix notation: these have an x- and a y-coordinate

Quadratic pieces, quadrics The (vector) coefficients a0 , a1 and a2 of the canonical form are not convenient for making curves It is more natural to describe quadrics using 3 points, one for f(0), one for f(0.5), and one for f(1) p0 = f(0) = a0 + 0 a1 + 02 a2 p1 = f(0.5) = a0 + 0.5 a1 + 0.52 a2 p2 = f(1) = a0 + 1 a1 + 12 a2 With linear algebra, we can convert a0 , a1 and a2 into p0 , p1 and p2 and vice versa

Quadrics p1 p2 p0 p2 p0 p1

Quadrics p0 = f(0) = a0 + 0 a1 + 02 a2 p1 = f(0.5) = a0 + 0.5 a1 + 0.52 a2 p2 = f(1) = a0 + 1 a1 + 12 a2 constraint matrix

Quadrics p0 = f(0) = a0 + 0 a1 + 02 a2 p1 = f(0.5) = a0 + 0.5 a1 + 0.52 a2 p2 = f(1) = a0 + 1 a1 + 12 a2 base matrix If you have the three points p0 , p1 and p2 , you can get the coefficients of the polynomial in canonical form

Quadrics Example 1: Given the points p0 = (0,1), p1 = (2,0) and p2 = (4,4), compute the coefficients of the polynomial in canonical form for which f(0) = p0, f(0.5) = p1 , and f(1) = p2 Solution: simply apply the base matrix B to ( p0 p1 p2 )T

Quadrics Example 2: Given the points p0 = (0,1), p1 = (2,0) and p2 = (4,4), compute the coefficients of the polynomial in canonical form for which f(0) = p0, f(0.3) = p1 , and f(1) = p2 Solution: determine the base matrix B for this case and apply it to ( p0 p1 p2 )T

Quadrics p0 = f(0) = a0 + 0 a1 + 02 a2 p1 = f(0.3) = a0 + 0.3 a1 + 0.32 a2 p2 = f(1) = a0 + 1 a1 + 12 a2 Now compute B = C – 1 and apply it to ( p0 p1 p2 )T

Quadrics We can specify the quadric using points and derivatives too two points and one derivate at a point one point, first derivative at a point and second derivative at a point p0 p1

Quadrics f(u) = a0 + a1 u + a2 u2 f’(u) = a1 + 2 a2 u f’’(u) = 2 a2 By specifying anything like p0 = f(0) , p1 = f’(0.6) , p2 = f’’(0.7) we can determine a (and therefore the quadric in canonical form) by setting up the constraint matrix, doing matrix inversion, and applying it to ( p0 p1 p2 )T

Quadrics f(u) = a0 + a1 u + a2 u2 f’(u) = a1 + 2 a2 u f’’(u) = 2 a2 For example: p0 = f(0.1) = a0 + 0.1 a1 + 0.12 a2 p1 = f’(0.6) = a1 + 2  0.6 a2 p2 = f’’(0.7) = 2 a2 Note: p1 and p2 are not points, but specifications of the first and second derivatives

Cubics Cubics are the most popular polynomial pieces They are determined by 4 coefficients so we can for instance specify the two endpoints and the two first derivatives at these endpoints This is important for building splines f(u) = a0 + a1 u + a2 u2 + a3 u3 p1 p2 p0 p3

Cubics p0 = f(0) = a0 + 0 a1 + 02 a2 + 03 a3 p1 = f’(0) = a1 + 0 a2 + 3  02 a3 p2 = f(1) = a0 + 1 a1 + 12 a2 + 13 a3 p3 = f’(1) = a1 + 1 a2 + 3  12 a3 This is the so-called Hermite form p1 p2 p0 p3

Cubics For example: p0 = (0,0), p1 = (0,2), p2 = (3,0), p3 = (2,0) point tangent vector point tangent vector p1 = (0,2) p3 = (2,0) p0 = (0,0) p2 = (3,0)

Summary There are three main ways to specify curves, parametric, implicit, and procedural There are different degrees of continuity of curves, important when designing piecewise defined curves We can build (parametric) linear curves from two specifications, quadric curves from 3 specifications and cubic curves from 4 specifications (through point, tangent at point, …) The constraint matrix and base matrix allow us to convert specifications into canonical form and v.v.