The Essentials of CAGD Chapter 11: Working with B-spline Curves - - PowerPoint PPT Presentation

the essentials of cagd
SMART_READER_LITE
LIVE PREVIEW

The Essentials of CAGD Chapter 11: Working with B-spline Curves - - PowerPoint PPT Presentation

The Essentials of CAGD Chapter 11: Working with B-spline Curves Gerald Farin & Dianne Hansford CRC Press, Taylor & Francis Group, An A K Peters Book www.farinhansford.com/books/essentials-cagd 2000 c Farin & Hansford The


slide-1
SLIDE 1

The Essentials of CAGD

Chapter 11: Working with B-spline Curves Gerald Farin & Dianne Hansford

CRC Press, Taylor & Francis Group, An A K Peters Book www.farinhansford.com/books/essentials-cagd

c 2000

Farin & Hansford The Essentials of CAGD 1 / 20

slide-2
SLIDE 2

Outline

1

Introduction to Working with B-spline Curves

2

Designing with B-spline curves

3

Least Squares Approximation

4

Shape Equations

5

Cubic Spline Interpolation

6

Cubic Spline Interpolation in a Nutshell

Farin & Hansford The Essentials of CAGD 2 / 20

slide-3
SLIDE 3

Introduction to Working with B-spline Curves

How to use B-spline curves? B-spline curves popularity due to the many possible ways in which they can be “put to work”

Farin & Hansford The Essentials of CAGD 3 / 20

slide-4
SLIDE 4

Designing with B-spline curves

Find: a B-spline curve for the character “v” in some fancy font Most basic design process: Move individual control points until desired shape achieved Manual/interactive method ok for final fine tuning of shape Initial “guess” can be created faster with methods in this chapter

Farin & Hansford The Essentials of CAGD 4 / 20

slide-5
SLIDE 5

Introduction to Working with B-spline Curves

Many applications supply a large number of data points ⇒ from scanning devices Find a cubic B-spline curve approximating their shape Most popular method: least squares approximation

Farin & Hansford The Essentials of CAGD 5 / 20

slide-6
SLIDE 6

Least Squares Approximation

Cubic B-spline curve defined by – L polynomial segments – Assume simple domain knots ⇒ number of knots K = L + 5 – Knot sequence u0, . . . , uK−1 Given P data points – p0, . . . , pP−1 – Each pi associated with parameter value vi Find a cubic B-spline curve x(u) such that the distances pi − x(vi) are small

Farin & Hansford The Essentials of CAGD 6 / 20

slide-7
SLIDE 7

Least Squares Approximation

B-spline curve x(u) = d0N3

0(u) + . . . + dD−1N3 D−1(u)

Given points pi = x(vi) i = 0, . . . , P − 1 leading to d0N3

0(v0) + . . . + dnN3 D−1(v0) = p0

. . . d0N3

0(vP−1) + . . . + dnN3 D−1(vP−1) = pP−1

In matrix form:       N3

0(v0)

. . . N3

D−1(v0)

. . . . . . N3

0(vP−1)

. . . N3

D−1(vP−1)

         d0 . . . dD−1    =       p0 . . . . . . pP−1       MD = P

Farin & Hansford The Essentials of CAGD 7 / 20

slide-8
SLIDE 8

Least Squares Approximation

Linear system MD = P is overdetermined – Number P of data points > number D of curve control points Solution: multiply both sides by MT: MTMD = MTP Linear system with D equations in D unknowns – Square and symmetric coefficient matrix MTM – Solution straightforward since MTM always invertible (parameter values vj must be “evenly” distributed in domain knots)

Farin & Hansford The Essentials of CAGD 8 / 20

slide-9
SLIDE 9

Least Squares Approximation

Parameters to define: – How many segments L should the curve have? – How to choose the knots uj – How to choose the parameter values vi? No universal answers – suggestions: Choose the parameters vi according to the chord length Select L ≈ P/10 Choose ui such that approximately ten vj fall in each interval domain knot interval [ui, ui+1]

Farin & Hansford The Essentials of CAGD 9 / 20

slide-10
SLIDE 10

Shape Equations

Possible data point defects: – noisy – unevenly distributed ⇒ Least squares approximation might fail to produce nice results Solution: modify method with shape information – Accept deviation from data for a better-shaped curve – Formulate conditions for the control polygon’s shape – Assumption: a polygon is nice if it does not wiggle much Expressed by computing second differences of control points ∆2di = di − 2di+1 + di+2 Less wiggle ⇒ smaller sum: S = ∆2d0 + . . . + ∆2dD−3

Farin & Hansford The Essentials of CAGD 10 / 20

slide-11
SLIDE 11

Shape Equations

Example Top polygon: S = 6

∆2d0 = −2

  • ∆2d1 =

2

  • ∆2d2 =

−2

  • Bottom polygon: S = 2

∆2d0 =

  • ∆2d1 =

−2

  • ∆2d2 =
  • ⇒ Bottom polygon is smoother

Farin & Hansford The Essentials of CAGD 11 / 20

slide-12
SLIDE 12

Shape Equations

Least squares approximation: Add shape equations to the

  • verdetermined system

d0 − 2d1 + d2 = 0 . . . dD−3 − 2dD−2 + dD−1 = 0 Overdetermined linear system becomes even more overdetermined Top: without shape equations Bottom: with shape equations

Farin & Hansford The Essentials of CAGD 12 / 20

slide-13
SLIDE 13

Cubic Spline Interpolation

Interpolation: # given data equals # unknown control points Given P data points p0, . . . , pP−1 Interpolate with a cubic B-spline curve x(u) End knots of multiplicity three:

u0 = u1 = u2 u3, . . . , uK−4 uK−3 = uK−2 = uK−1

Junction points paired with pi x(u2) = p0, . . . ⇒ P − 1 curve segments ⇒ K = P + 4 knots ⇒ D = P + 2 control points

Farin & Hansford The Essentials of CAGD 13 / 20

slide-14
SLIDE 14

Cubic Spline Interpolation

Example Given P = 5 data points Need K = 5 + 4 = 9 knots 0, 0, 0, 1, 2, 3, 4, 4, 4 ⇒ D = 7 control points d0, . . . , d6

Farin & Hansford The Essentials of CAGD 14 / 20

slide-15
SLIDE 15

Cubic Spline Interpolation

Two more data items are needed than the curve has junction points Solution: add two more data items at the ends of the curve ts = ˙ x(u2) start tangent te = ˙ x(uK−3) end tangent These are called end conditions Knots u2 and uK−3 are the first and last domain knots Bessel tangents method: extract tangents from interpolating parabola through first and last three data points – See The Essentials of CAGD for equation details

Farin & Hansford The Essentials of CAGD 15 / 20

slide-16
SLIDE 16

Cubic Spline Interpolation

Interpolation conditions:

p0 = x(u2) ts = ˙ x(u2) p1 = x(u3) . . . te = ˙ x(uK−3) pP−1 = x(uK−3)

Triple end knots result in d0 = p0 and dD−1 = pP−1 ⇒ eliminates two unknowns ⇒ eliminates two equations Simplified interpolation conditions:

ts = ˙ x(u2) p1 = x(u3) . . . pP−2 = x(uK−4) te = ˙ x(uK−3)

For unknowns d1, . . . , dD−2

Farin & Hansford The Essentials of CAGD 16 / 20

slide-17
SLIDE 17

Cubic Spline Interpolation

Example Revisit previous example p0 = x(0) ts = ˙ x(0) p1 = x(1) p2 = x(2) p3 = x(3) te = ˙ x(4) p4 = x(4) Assigning d0 = p0 and d6 = p4 System becomes ts = ˙ x(0) p1 = x(1) p2 = x(2) p3 = x(3) te = ˙ x(4) ⇒ five equations for the unknowns d1, . . . , d5

Farin & Hansford The Essentials of CAGD 17 / 20

slide-18
SLIDE 18

Cubic Spline Interpolation

Each data point yields an equation of the form pi = d0N3

0(u2+i) + . . . + dD−1N3 D−1(u2+i)

Due to the local support property of B-spline curves pi = diN3

i (u2+i) + di+1N3 i+1(u2+i) + di+2N3 i+2(u2+i)

⇒ tridiagonal structure End conditions: first and last equation in the system – For tridiagonal structure, must involve only the first and last unknowns For the special case of equally spaced interior knots 6pi = di + 4di+1 + di+2 for each equation involving a data point

Farin & Hansford The Essentials of CAGD 18 / 20

slide-19
SLIDE 19

Cubic Spline Interpolation

Example – Equally spaced knots – End tangent equations: ts = 3(d1 − d0) and te = 3(d6 − d5)

      1 3/2 7/2 1 1 4 1 1 7/2 3/2 1             d1 d2 d3 d4 d5       =       d0 + 1

3ts

6p1 6p2 6p3 d6 − 1

3te

     

Farin & Hansford The Essentials of CAGD 19 / 20

slide-20
SLIDE 20

Cubic Spline Interpolation in a Nutshell

Input: – Data points p0, . . . , pP−1 – A cubic B-spline knot sequence u0 = u1 = u2, u3, . . . , uK−4, uK−3 = uK−2 = uK−1 K = P + 4 ⇒ P − 1 curve segments Find: cubic B-spline interpolant – Control points d0, . . . , dD−1 where D = P + 2 – Each data point pi is associated with parameter u2+i Compute: Set d0 = p0 and dD−1 = pP−1 Create tangents ts and te using Bessel tangent equations Set up the tridiagonal linear system of equations Solve the (D − 2) × (D − 2) linear system for d1, . . . , dD−2

Farin & Hansford The Essentials of CAGD 20 / 20