Docsity

Computer Graphics I: NURBS Drawing - Conic Sections & de Boor's Algorithm - Prof. David E., Assignments of Computer Graphics

Partial preview of the text

Download Computer Graphics I: NURBS Drawing - Conic Sections & de Boor's Algorithm - Prof. David E. and more Assignments Computer Graphics in PDF only on Docsity!

1

CS 430/

Computer Graphics I

NURBS Drawing

Week 5, Lecture 10 David Breen, William Regli and Maxim Peysakhov Geometric and Intelligent Computing Laboratory Department of Computer Science Drexel University http://gicl.cs.drexel.edu

2

Outline

  • Conic Sections via NURBS
  • Knot insertion algorithm
  • The de Boor’s algorithm
    • for B-Splines
    • for NURBS
  • Oslo Algorithm
  • Barycentric Coordinates
  • Discussion of homework #

4

Conic Sections via NURBS

  • Define the curve with three control points
  • Weights of first/last control points are 1
  • For center control point
    • w<1 gives an ellipse
    • w>1 gives a hyperbola
    • w=1 gives a parabola
    • Knot vector is {0.0, 0.0,0.0, 1.0, 1.0, 1.0} From http://devworld.apple.com/dev/techsupport/develop/issue25/schneider.html

5

Conic Sections via NURBS:

A Circular Arc

  • The two sides of the control polygon are of equal length
  • The chord connecting the first and last control points meets each leg at an angle q equal to half the angular extent of the desired arc (for instance, 30° for a 60° arc)
  • The weight of the inner control point is equal to the cosine of q
  • Knot vector is {0.0, 0.0, 0.0, 1.0, 1.0, 1.0} From http://devworld.apple.com/dev/techsupport/develop/issue25/schneider.html

7

Conic Sections via NURBS

Example:

4 arcs of 90°

From http://devworld.apple.com/dev/techsupport/develop/issue25/schneider.html † B 3 = - 1 , 1 , 2 { 2 } † B 1 = 1 , 1 , 2 { 2 } † B 7 = 1 ,- 1 , 2 { 2 } † B 5 = - 1 ,- 1 , 2 { 2 }

8

Knot Insertion

  • Issue: More control points

mean more control

  • How do we add more points

and keep same curve?

From http://devworld.apple.com/dev/techsupport/develop/issue25/schneider.html

10

Knot Insertion

  • Given: n+1 control points (P 0
, P

1

, ..., P

n ), a knot vector of m+1 knots U = { u 0 , u , ..., u m } and a degree d B- spline curve C(u).

  • Insert a new knot t into the knot vector without changing the shape of the curve.
  • If t lies in knot span [u k , u k+ ), only the basis functions for (P k
, … P

k-d ) are non-zero.

  • Find d new control points Q k on edge P k-
P

k

, Q

k- on edge P k-

P

k- , ..., and Q k-d+ on edge P k-d

P

k-d+

  • All other control points are unchanged.
  • Note that d-1 control points of the original control polyline are removed and replaced with d new control points. See http://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/spline/B-spline/single-insertion.html

11

Knot Insertion Algorithm

  • Create new control point Q j = (1– a j )P j- + a j P j
  • Where a is defined as a j = t - u j u j + d
  • u j See http://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/spline/B-spline/single-insertion.html

13

The de Boor Algorithm

  • Generalization of de Casteljau's

algorithm

  • It provides a fast and numerically

stable way for finding a point on a

B-spline curve

  • Observation: if a knot u is inserted

d times to a B-spline, then p(u) is

the point on the curve.

  • Idea: We just simply insert u d

times and the last point is p ( u )!

Compiled from Lecture notes of Dr. Ching-Kuang Shene @ Michigan Technological University See http://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/spline/B-spline/de-Boor.html

14

The de Boor Algorithm

16

The de Boor Algorithm

17

The de Boor Algorithm

19

De Boor’s Algorithm

If u lies in [ u

k

, u

k +

) and u != u

k

, let h = d
If u = u

k

and u

k

is a knot of multiplicity s , let h = d – s
Copy the affected control points p

k-s

, p

k-s -

,..., p

k-d +

, p

k-d

to a new array and rename them as p

k-s ,

, p

k-s -1,

, ..., p

k-d +1,

for r := 1 to h do
for i := k-d+r to k-s do
Let a

i,r

= ( u - u

i

) / ( u

i+d-r +

  • u i
Let p

i,r

= (1 - a

i,r

) p

i -1, r -

+ a

i,r

p

i , r -

p

k-s,d-s

is the point p ( u ).

Compiled from Lecture notes of Dr. Ching-Kuang Shene @ Michigan Technological University

21

De Boor’s Algorithm ( cont )

for u := 0 to umax do { … for r := 1 to h do for i := k-p+r to k-s do { Let a i,r = ( u - u i ) / ( u i+p-r +

  • u i ) Let p i,r = (1 - a i,r ) p i -1, r -
  • a i,r p i , r - } p k-s,p-s is the point p ( u ). } Compiled from Lecture notes of Dr. Ching-Kuang Shene @ Michigan Technological University