07 - Designing Interpolating Curves Acknowledgement: Olga - - PowerPoint PPT Presentation

07 designing interpolating curves
SMART_READER_LITE
LIVE PREVIEW

07 - Designing Interpolating Curves Acknowledgement: Olga - - PowerPoint PPT Presentation

07 - Designing Interpolating Curves Acknowledgement: Olga Sorkine-Hornung, Alexander Sorkine-Hornung, Ilya Baran CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo How do we model shapes? Delcam Plc. [CC BY-SA 3.0


slide-1
SLIDE 1

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

07 - Designing Interpolating Curves

Acknowledgement: Olga Sorkine-Hornung, Alexander Sorkine-Hornung, Ilya Baran

slide-2
SLIDE 2

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

How do we model shapes?

Delcam Plc. [CC BY-SA 3.0 (http://creativecommons.org/licenses/by-sa/3.0) or GFDL (http://www.gnu.org/copyleft/fdl.html)], via Wikimedia Commons

slide-3
SLIDE 3

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Building blocks: curves and surfaces

By Wojciech mula at Polish Wikipedia, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=9853555

slide-4
SLIDE 4

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

A modeling session

  • Demo with Keynote for 2D
  • Demo with Blender for 3D
slide-5
SLIDE 5

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Modeling curves

  • We need mathematical concepts to characterize the desired curve

properties

  • Notions from curve geometry help with designing user interfaces

for curve creation and editing

slide-6
SLIDE 6

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

2D parametric curve

  • must be continuous
slide-7
SLIDE 7

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

A curve can be parameterized in many different ways

slide-8
SLIDE 8

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Tangent vector

Parametrization-independent!

slide-9
SLIDE 9

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Arc length

  • How long is the curve between and ? How far does the particle

travel?

  • Speed is , so:
  • Speed is nonnegative, so is non-decreasing
slide-10
SLIDE 10

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Arc length parameterization

  • Every curve has a natural parameterization:
slide-11
SLIDE 11

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Arc length parameterization

  • Every curve has a natural parameterization:
  • Isometry between parameter domain and curve
  • Tangent vector is unit-length:
slide-12
SLIDE 12

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Curvature

  • How much does the curve turn per unit ?
slide-13
SLIDE 13

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Curvature

  • How much does the curve turn per unit ?
slide-14
SLIDE 14

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Curvature profile

  • Given , we can get up to a constant by integration.

Integrating reconstructs the curve up to rigid motion.

slide-15
SLIDE 15

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Curvature of a circle

  • Curvature of a circle:

Osculating circle

= Unit Normal

slide-16
SLIDE 16

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Frenet Frame

slide-17
SLIDE 17

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Curvature normal

  • Points inward
  • useful for evaluating curve quality
slide-18
SLIDE 18

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Smoothness

Two kinds, parametric and geometric:

Parametrization-Independent

slide-19
SLIDE 19

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Smoothness example

slide-20
SLIDE 20

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Recap on parametric curves

slide-21
SLIDE 21

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Turning

  • Angle from start tangent to end tangent:
  • If curve is closed, the tangent at the beginning is the same as the

tangent at the end

slide-22
SLIDE 22

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Turning numbers

  • measures how many full turns the tangent makes.

1 –1 2

slide-23
SLIDE 23

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Space curves (3D)

  • In 3D, many vectors are orthogonal to T
  • are the “Frenet frame”
  • is torsion: non-planarity

N T B

slide-24
SLIDE 24

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Designing Curves:
 Polynomials and Interpolation

slide-25
SLIDE 25

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Basic idea for curve design

  • User gives us points. We need to connect the dots in a smooth way.
  • The dots stay as “handles” on the curve. User can move the dots and the

curve follows.

slide-26
SLIDE 26

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Basic idea for curve design

  • User gives us points. We need to connect the dots in a smooth way.
  • The dots stay as “handles” on the curve. User can move the dots and the

curve follows.

slide-27
SLIDE 27

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Keynote Demo

slide-28
SLIDE 28

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Blender Demo

slide-29
SLIDE 29

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Polynomial curves

  • Polynomials
  • For degree we need points (“coefficients”)
slide-30
SLIDE 30

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Polynomials

  • Parametric form with polynomials



 
 
 


  • Control shape?
slide-31
SLIDE 31

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Polynomials

  • Parametric form with polynomials



 
 
 


  • Control shape?
slide-32
SLIDE 32

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Polynomials

  • Parametric form with polynomials



 
 
 


  • Control shape?
slide-33
SLIDE 33

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Polynomials

  • Parametric form with polynomials



 
 
 


  • Control shape?
slide-34
SLIDE 34

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Polynomials

  • Parametric form with polynomials



 
 
 


  • Control shape?
slide-35
SLIDE 35

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Polynomials

  • Parametric form with polynomials



 
 
 


  • Control shape?
slide-36
SLIDE 36

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Polynomials

  • Parametric form with polynomials



 
 
 


  • Control shape?
slide-37
SLIDE 37

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Polynomials

  • Parametric form with polynomials



 
 
 


  • Control shape?
  • Monomial coefficients 


are not intuitive

slide-38
SLIDE 38

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Interpolation (1D)

  • Interpolate control points
  • Find polynomial 


with

slide-39
SLIDE 39

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Interpolation (1D)

  • Interpolate control points
  • Find polynomial 


with

slide-40
SLIDE 40

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Interpolation (1D)

  • Interpolate control points
  • Find polynomial 


with

  • Solve

Vandermonde matrix

slide-41
SLIDE 41

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Interpolation (1D)

  • Interpolate control points
  • Find polynomial 


with

  • Solve
slide-42
SLIDE 42

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Interpolation (1D)

  • Interpolate control points
  • Find polynomial 


with

  • Solve
slide-43
SLIDE 43

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Interpolation (1D)

  • Polynomial fitting can be done explicitly:
  • Check that
  • Products are called Lagrange polynomials
slide-44
SLIDE 44

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Example of 1D Interpolation

slide-45
SLIDE 45

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Recap

  • Monomial coefficients unintuitive
  • Lagrange interpolation is better, but there is a global effect
  • The possible curves are the same: just cubics
slide-46
SLIDE 46

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Polynomials form a vector space

  • You can add and subtract them
  • You can multiply them by real numbers
  • These operations follow the usual rules
  • Associativity, commutativity, inverses for addition
  • Distributivity for scalar multiplication
  • Etc.
  • Anything you can do with vectors in general, you can do with

polynomials.

slide-47
SLIDE 47

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Monomial basis for cubics:

slide-48
SLIDE 48

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Interpolation basis for :

slide-49
SLIDE 49

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Remark

  • Basis change is just a matrix multiplication
  • We need to find a good basis for intuitively designing curves
slide-50
SLIDE 50

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Interpolation in 2D

  • We now have pairs we want to interpolate:
  • How to choose ’s at which to specify ?
  • Parameter space matters!
slide-51
SLIDE 51

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Runge’s phenomenon

slide-52
SLIDE 52

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Splines

  • Paste together low-degree polynomials

Cubic C u b i c Cubic C u b i c C u b i c

slide-53
SLIDE 53

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

How do we get smoothness?

  • With Lagrange polynomials, it’s hard to get tangents to match up
slide-54
SLIDE 54

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Hermite Basis

  • Instead of four points, specify two points and two derivatives:

Cubic polynomials of the form

p(t0) = p0 p(t1) = p1 p0(t0) = m0 p0(t1) = m1

slide-55
SLIDE 55

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Hermite Basis

  • Instead of four points, specify two points and two derivatives:
slide-56
SLIDE 56

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Catmull-Rom splines

  • If no tangents are explicitly specified – get them from the input

points!

slide-57
SLIDE 57

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

Next time

  • Approximating Curves
  • Bezier splines
  • B-splines
slide-58
SLIDE 58

CSCI-GA.2270-001 - Computer Graphics - Daniele Panozzo

References

Fundamentals of Computer Graphics, Fourth Edition 4th Edition by Steve Marschner, Peter Shirley Chapter 15