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

Similar documents
Computer Graphics Curves and Surfaces. Matthias Teschner

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

Information Coding / Computer Graphics, ISY, LiTH. Splines

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

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

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

Objects 2: Curves & Splines Christian Miller CS Fall 2011

Design considerations

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

Central issues in modelling

Parametric curves. Brian Curless CSE 457 Spring 2016

Curves and Surfaces Computer Graphics I Lecture 9

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

Curves and Surfaces 1

2D Spline Curves. CS 4620 Lecture 18

Introduction to Computer Graphics

08 - Designing Approximating 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

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

3D Modeling Parametric Curves & Surfaces

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

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

COMPUTER AIDED ENGINEERING DESIGN (BFF2612)

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

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

2D Spline Curves. CS 4620 Lecture 13

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

Sung-Eui Yoon ( 윤성의 )

Shape modeling Modeling technique Shape representation! 3D Graphics Modeling Techniques

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

CS-184: Computer Graphics

B-spline Curves. Smoother than other curve forms

An Introduction to B-Spline Curves

Curves. Computer Graphics CSE 167 Lecture 11

Rational Bezier Curves

Curves and Surfaces. CS475 / 675, Fall Siddhartha Chaudhuri

COMPUTER AIDED GEOMETRIC DESIGN. Thomas W. Sederberg

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

The Free-form Surface Modelling System

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

MA 323 Geometric Modelling Course Notes: Day 31 Blended and Ruled Surfaces Coons Patches

Computer Animation. Rick Parent

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

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

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

Fathi El-Yafi Project and Software Development Manager Engineering Simulation

Curves and Surfaces Computer Graphics I Lecture 10

Splines. Connecting the Dots

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

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

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

On Smooth Bicubic Surfaces from Quad Meshes

CS337 INTRODUCTION TO COMPUTER GRAPHICS. Describing Shapes. Constructing Objects in Computer Graphics. Bin Sheng Representing Shape 9/20/16 1/15

Geometric Modeling of Curves

Properties of Blending Functions

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

COMP3421. Global Lighting Part 2: Radiosity

Lecture IV Bézier Curves

CS123 INTRODUCTION TO COMPUTER GRAPHICS. Describing Shapes. Constructing Objects in Computer Graphics 1/15

Computer Graphics Splines and Curves

Computergrafik. Matthias Zwicker. Herbst 2010

CS-184: Computer Graphics. Today

(Spline, Bezier, B-Spline)

Intro to Curves Week 4, Lecture 7

Figure 5.1: Spline and ducks.

Introduction p. 1 What Is Geometric Modeling? p. 1 Computer-aided geometric design Solid modeling Algebraic geometry Computational geometry

BS-Patch: Constrained Bezier Parametric Patch

A Practical Review of Uniform B-Splines

Bezier Curves, B-Splines, NURBS

Curves and Surfaces for Computer-Aided Geometric Design

Intro to Modeling Modeling in 3D

Curves and Surface I. Angel Ch.10

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

Spline Curves. Spline Curves. Prof. Dr. Hans Hagen Algorithmic Geometry WS 2013/2014 1

Interpolating/approximating pp gcurves

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

09 - Designing Surfaces. CSCI-GA Computer Graphics - Fall 16 - Daniele Panozzo

Spline Surfaces, Subdivision Surfaces

INF3320 Computer Graphics and Discrete Geometry

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

Kochanek-Bartels Cubic Splines (TCB Splines)

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

CS354 Computer Graphics Surface Representation III. Qixing Huang March 5th 2018

Lecture 9: Introduction to Spline Curves

Subdivision Surfaces

A MATRIX FORMULATION OF THE CUBIC BÉZIER CURVE

Intro to Curves Week 1, Lecture 2

Surfaces for CAGD. FSP Tutorial. FSP-Seminar, Graz, November

Surface Modeling. Polygon Tables. Types: Generating models: Polygon Surfaces. Polygon surfaces Curved surfaces Volumes. Interactive Procedural

A Curve Tutorial for Introductory Computer Graphics

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

Free-Form Deformation (FFD)

CS 536 Computer Graphics Intro to Curves Week 1, Lecture 2

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

9. Three Dimensional Object Representations

An introduction to interpolation and splines

OUTLINE. Quadratic Bezier Curves Cubic Bezier Curves

3D Modeling techniques

For each question, indicate whether the statement is true or false by circling T or F, respectively.

Advanced Modeling 2. Katja Bühler, Andrej Varchola, Eduard Gröller. March 24, x(t) z(t)

Transcription:

Spline Notes Marc Olano University of Maryland, Baltimore County February, 4 Introduction I. Modeled after drafting tool A. Thin strip of wood or metal B. Control smooth curved path by running between small weights or ducks Image from www.frets.com II. Graphics version = parametric curve: p(s) A. Control Points. Points in space that control spline s shape. Like ducks in drafting splines. Interpolating = spline passes through control points 3. Approximating = spline passes near but not necessarily through control points (most popular) B. Non-rational/ordinary: P(s) = vector of desired dimension ( ) X(s) D : P(s) = (X(s)); D : P(s) = ; 3D : P(s) = X(s) Y(s) Y(s) Z(s)

C. Rational: p(s) = homogeneous vector x(s) y(s) p(s) = z(s) z(s) where X Y = x/w y/w Z z/w D. Tangent, Normal, Binormal A. Tangent, ˆT = vector in direction of curve B. Normal, ˆN = vector normal to curve, in direction of greatest curvature. C. Binormal, ˆB = vector normal to curve, perpendicular to tangent and normal D. Define in terms of st and nd derivatives of curve: P (s) = X (s) Y (s) = velocity(s) ˆT(s) Z (s) P (s) = X (s) Y (s) = linearaccel(s) ˆT(s) + centripidalaccel ˆN(s) Z (s) E. Together, these make the Frenet Frame ˆT, ˆN, ˆB ) ˆT(s) = normalize( P (s) ) ˆB(s) = normalize( P (s) P (s) ˆN(s) = ˆB(s) ˆT(s) Polynomial splines I. About the only splines you will ever see. II. Most common in graphics: cubic (s 3 ) for general rendering, quintic (s 5 ) for CAD X(s) = as 3 + bs + cs+d = (a b c s d) s X (s) = 3as + bs+c = (a b c d) X (s) = 6as+b = (a b c d) III. Constraints s 3 3s s 6s = (a b c d) s = (a b c d) s = (a b c d) s

A. Degree n polynomial has n+ coefficients: as+b; as + bs+c; as 3 + bs + cs+d;... B. Solving for n+ unknown coefficients requires n+ constraints (so for cubic, you need 4) Typical types of constraints:. Pass through X i at s i X i = (a b c d) = (a b c d) s i s 3 i s i s i. Have derivative X i at s i X 3. Have nd derivative X i IV. Fitting many control points 3s i s i = (a b c d) i = (a b c d) s i X at s i i = (a b c d) = (a b c d) s i 6s i A. Global: fit with large system / high-degree polynomial. + Single curve. Every control point has some affect on the entire curve B. Piecewise: fit with many short curves, joined end-to-end. + Control points only affect local curve. Must use some constraints to keep joins smooth 3 Spline zoo I. Hermite A. Give position and derivatives at each endpoint 3

X, X at s = s = ; X, X at s = s = Use conditions of the form X() = X = as 3 + by + cs + d = d X() = X = as 3 + bs + cs + d = a+b+c+d X () = X = 3as + bs + c = c X () = X = 3as + bs + c = 3a+b+c Or in matrix form: (X X X X ) = (a b c d)( s s s s ) 3 = (a b c d) = (a b c d) H Even though X(s) is a polynomial in s, it is linear in a, b, c and d. Solve as linear equation! (a b c d) = (X X X X ) H 3 = (X X X X ) 3 B. Can reuse this matrix for any curve specified by value and derivatives at the endpoints C. Can also reuse the same matrix for each component of the curve: P(s) = X(s) Y(s) = Z(s) a X b X c X d X a Y b Y c Y d Y a Z b Z c Z d Z = ( A B C D) s s 3 s s a X b X c X d X a Y b Y c Y d Y = X X X X Y Y Y Y H a Z b Z c Z d Z Z Z Z Z ( A B C D) = ( P P P P ) H 4

II. Natural A. value, st and nd derivatives at s = match previous B. Even though segmented, each control point has global effect on all segments! C. Create single linear system to solve for coefficients of all curve segments. D. Natural because behavior is similar to drafting spline III. Interpolating A. To fit m points, need polynomial of degree n = m B. Single curve, each control point has global influence C. Example: fit four points with a cubic P at s = s =, P at s = s = 3, P at s = s = 3, and P 3 at s = s 3 = ( P P P P 3 ) = ( A B C D)( s s s s 3 ) 8 7 7 4 = ( A B C D) 9 9 3 3 = ( A B C D) M ( A B C D) = ( P P P P 3 ) M 9 9 7 = ( P P P P 3 ) 45 9 7 8 9 9 9 D. Basis functions Full spline equation is P(s) = ( P P P P 3 ) M s Grouping control points and matrix gives coefficients. 5

P(s) = [ ( P P P P 3 ) M ] s Grouping matrix and polynomial terms gives a polynomial basis functions for each control point. Total curve is a weighted average of the control points, with the weights given by the basis functions: P(s) = ( P P P P 3 ) [ M s ] f (s) f = ( P P P P 3 ) (s) f (s) f 3 (s) = P ( 9 s3 + 9s s+)+ P ( 7 s3 45 s + 9s)+ P ( 7 s3 + 8s 9 s)+ P 3 ( 9 s3 9 s + s) E. Here is a graph of these four basis functions IV. Catmull-Rom..8.6.4. -. -.4..4.6.8 A. Too hard to give derivatives, so derive them from control points. B. Endpoints P, P C. Derivatives ( P P ), ( P 3 P ) D. Chosen to pass through all points, match value and st derivative at st endpoint, and preserve local control E. Matrix (a b c d) = ( P P ( P P ) ( P 3 P )) H 6

Can use that equation as-is, or rearrange to find basis functions P(s) = ( P P ( P P ) ( P 3 P )) H s = ( P P P P 3 ) H s s3 + s s 3 s3 5 s + = ( P P P P 3 ) 3 s3 + s + s s 3 s V. Cardinal.8.6.4. -...4.6.8 A. Catmull-Rom is good, but not enough control B. Add tension parameter, τ to derivative terms C. Endpoints P, P D. Derivatives ( τ ) ( P P ), ( τ ) ( P 3 P ) E. τ = cusp < τ < sharper than Catmull-Rom τ = Catmull-Rom τ < flatter than Catmull-Rom F. Example with τ = and τ G. Matrix (a b c d) = ( P P τ ( P P ) τ ( P 3 P )) H 7

H. Basis functions: τ P(s) = ( P P τ ( P P ) ( P 3 P )) H s τ = ( P P P P 3 ) τ τ H s τ τ s 3 +( τ )s τ ( ) ) s τ = ( P P P P 3 ) s +( 3 τ 3 s + ( ) τ s 3 +(3 ( τ ))s + τ τ s 3 τ s I. Graph of basis functions for τ =, τ = s VI. Beziér A. Most common B. Endpoints P, P 3.8.6.4. C. Derivatives P P, P 3 P -...4.6.8 D. Match derivatives by choice of interior control points locations on successive segments E. Matrix (a b c d) = ( P P 3 P P P 3 P ) H F. Can also find points on Beziér curves using decastlejau s algorithm. To find the point /n of the way along the curve, find the points /n of the way between each pair of control points. Then find the point /n of the way between each 8

pair of points just found. Then find the point /n of the way between the two points just found. decastlejau s algorithm generalizes easily to Beziér curves of higher (or lower) degree than just cubic. Just iterate the successive subdivisions as many times as necessary until you get to a single point. G. Basis functions P(s) = ( P P 3 P P P 3 P ) H s = ( P P P P 3 ) H s s 3 s s+ s = ( P P P P 3 ) 3 s + s s 3 + s s 3 + s.8.6.4...4.6.8 These are known as the Bernstein basis functions. Beziér curves can be extended to any degree r polynomial using the n basis functions ( ) n B n,r (s) = t r r ( t) n r In terms of the Bernstein basis functions, the curve equation is P(s) = n i= P i B n,i (s) 4 Patches I. Create a rectangular patch by smoothly changing each control points of one spline curve along paths given by crossing set of spline curves. 9

II. The patch is symmetric in which direction you consider to be the control splines and which direction is the splines that sweep out the surface. ( P(s,t) = n i= m j= ) P i, j B n,i (s) B n, j (t) ) = n i= j=( m P i, j B n,i (s)b m, j (t) ) = m j= i=( n P i, j B n,i (s)b m, j (t) ( = m j= n i= ) P i, j B m, j (t) B n,i (s) III. P i, j is known as the control mesh IV. Render by subdividing (not covered here) or tessellating into polygons.