lec7param

Upload: dilipkkr

Post on 02-Jun-2018

215 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/10/2019 Lec7Param

    1/23

    Shape Modeling

    Parametric Representation Technique I

    Lecture 7

    Convex Hulls

    An important and useful property of B ier cur!es is that of the con!e"

    hull property #$%P&' The $%P and the de $astel(au algorithm lead

    naturally to geometric algorithms for rendering a B ier cur!e) and for

    finding the points of intersection of t*o Be ier cur!es' In order to descri+e

    the $%P it is necessary to define the con!e" hull of a set of points' ,i!en a

    set of points - . /" 0) " 1) ''' ) " n2 the con!e" hull of -) denoted +y $%/-2)

    is defined to +e the set of points

    $%/"2 . /a 0" 0 3''' 3a n" n 4i

    n

    =

    0ai. 1 ) a i 02 #1&

    5or points in a plane) the con!e" hull $%/-2 may +e !isuali ed as

    follo*s' Imagine an 6elastic +and placed around the entire set of points'

    The +and is permitted to shrin8 around the points to form a polygon) the

    !ertices of *hich are a su+set of the original set of points' The region

    +ounded +y the polygon is the con!e" hull of the set of points'

  • 8/10/2019 Lec7Param

    2/23

    The definition of the con!e" hull is !alid for points in space' The intuiti!e

    elastic +and is replaced +y an 6elastic +alloon *hich is permitted to shrin8

    around the points to form a polyhedron' The con!e" hull is the region

    +ounded +y the polyhedron' Se!eral e"amples of con!e" hulls are

    illustrated in 5ig' 1'

    Figure 1 ' $on!e" hulls

    Properties of Bzier Curves

    Theorem 9

    A B ier cur!e B#t& of degree n *ith control points b 0) ''') + n satisfies the

    follo*ing properties'

    Endpoint Interpolation Property :

    B#0& . b 0 and B#1& . b n'

    Endpoint Tangent Property :

    B #0& . n#b 0 ; b 1& andB

    #1& . n#b n ; b n;1&

  • 8/10/2019 Lec7Param

    3/23

    Convex Hull Property (CHP):

    5or all t

  • 8/10/2019 Lec7Param

    4/23

    Proof

    $onsidere the proof of $on!e" %ull Property and Afflne In!ariance

    Property'

    #$on!e" %ull Property & 5rom the definition of the con!e" hull e"pressed

    in equation #1& it is sufficient to sho* that e!ery point B#t& on a Be ier

    cur!e has the form a 0b 0 3''' 3a nb n for some constants a i satisfyingi

    n

    =

    0ai .

    1' Let a i . B i)n#t&) then positi!ity implies a i 0) the partition of unity

    implies thati

    n

    =

    0ai . 1) and the proof is complete' 5igure 9 illustrates the

    $%P for a cu+ic B ier cur!e'

    Figure 2 ' Illustration of the con!e" hull property for a cu+ic Be ior cur!e

    #Afflne In!ariance& Let an affne transformation T +e gi!en +y

    #"@)y@& .#a" 3 +y3c)d"3ey 3 f&)

  • 8/10/2019 Lec7Param

    5/23

  • 8/10/2019 Lec7Param

    6/23

    $onsider a cu+ic B ier cur!e *ith !ertices b 0#1) 0&)b 1#9) &)b 9# ) C&) and

    b #9) 1&' To apply a rotation through an angle

    DC a+out the origin in the

    anticloc8*ise direction to the cur!e) it is sufficient to apply the rotation

    matri" Rot# DC& to the homogeneous coordinates of the control points'

    %0%

    &'%

    ()%

    &%%

    cos * sin *

    sin * cos *

    ) )0

    ) )0

    00%

    0+0+0+0+%0

    0+0+'(',%0

    0+0+&%&%%0

    - - -

    - - -

    - - -

    The control points of the rotated cur!e are b 0#0'707)0'707&) b 1#;0'707)

    ' E&) b 9#0'707) E' EC&) and b #0'707) 9'191&' The cur!e and its rotated

    image are illustrated in 5igure '

    Figure 3 ' Application of a rotation to a cu+ic B ier cur!e

  • 8/10/2019 Lec7Param

    7/23

    5igure C illustrates t*o lines intersecting a B ier cur!e and its control

    polygon' The upper line intersects the polygon in t*o points +ut does not

    intersect the cur!e' The lo*er line intersects +oth the polygon and the

    cur!e in t*o points' In +oth cases) the num+er of intersections *ith the

    gi!en line is equal to or greater than the num+er of intersections of the line

    *ith the cur!e' Thus the !ariation diminishing property is satisfied' The

    proof of the !ariation diminishing property can +e found in ariation diminishing property

    Exer!ises

    99' Plot the cu+ic Be ier cur!e defined +y control points b 0#0) 1&)b 1#9' &)

    b 9#C) E&) andb #F) 1&' Gn the same plot) dra* the control polygon'

    G+ser!e that the resulting cur!e satisfies the con!e" hull property' He"t

    plot the Be ier cu+ic *ith control points b 0#1) 1&)b 1# 'C) 1'F&)b 9#E) E' &)

    and b # )1&' ?oes the ne*ly displayed cur!e !iolate the con!e" hull

    propertyJ K"plain'

  • 8/10/2019 Lec7Param

    8/23

  • 8/10/2019 Lec7Param

    9/23

    case of a cu+ic B ier cur!e *ith control points b 0) b 1) b 9) and b ) and for

    a specified parameter !alue t

  • 8/10/2019 Lec7Param

    10/23

    The algorithm gi!es the follo*ing ta+le of points'

    #1'0)1'0& #9'0)7'0& #F'0)E'0& #19'0)9'0&

    DC 1DC DC 1DC DC 1DC

    #1'9 '9' & # ' 'E'7 & # '0) '0&

    DC 1DC DC 1DC

    #1'F19 ) ' E9 & #C'F7 )E' 19 &

    DC 1DC

    #9' 7F)C'9 &

    The algorithm yields B#0'9 & . #9' 7F) C'9 &' ,eometrically) each step of

    the algorithm is a linear interpolation of the control polygon as illustrated

    in 5igure '

    Figure ' ' The de $astel(au algorithm *ith t . 0'9

  • 8/10/2019 Lec7Param

    11/23

    Theorem

    Let a Be ier cur!e of degree n +e gi!en +y control points b 0) ''' ) b n) and let

    t

  • 8/10/2019 Lec7Param

    12/23

    .i

    n

    =

    0

    %

    #b i#1; t& 3b i31 t&Bi)n;1#t&'

    Set b 1i . b i#1; t& 3b i31 t& . b oi#1; t& 3b oi31 t& for i . 0) ''' ) n;1) then

    B#t& .i

    n

    =

    0

    %

    b 1iBi)n;1#t& # &

    Kquation # & e"presses B#t& as a Be ier cur!e of degree n ; 1 *ith control

    points b 10) ''' ) b 1n;1' ' Applying a similar argument yields

    B#t& .i

    n

    =

    0

    &

    b 9iBi)n;9#t&

    *here b 9i31 . b 1i#1; t& 3b 1i31 t& for i . 0) ''' ) n;9' In general)

    B#t& .i

    n /

    =

    0

    b (iBi)n;(#t&

    *here b (i . b (;1 i#1; t& 3b (;1i31 t& for i . 0) ''' ) n;(' In particular) ( . n gi!es

    B#t& .i =

    0

    0

    b niBi)n;n#t& . b n0'

    Exer!ises

    9E' A cu+ic Be ier cur!e has control points b 0#1) 0&)b 1# ) &) b 9# ) &)

    and b #7) 9&' K!aluate the point B#0'9 & +y #a& applying the de $astel(au

    algorithm) and #+& su+stituting t . 0'9 into the defining equation of the

    B ier cur!e' Ma8e a s8etch illustrating the points deri!ed in applying de

    $astel(au algorithm'

  • 8/10/2019 Lec7Param

    13/23

  • 8/10/2019 Lec7Param

    14/23

    $astel(au algorithm to B#t& *ith t . ' 5or a cu+ic Be ier cur!e) the

    theorem implies that the control points of B left#t& areb 00) b 10) b 90) b 0) and

    the control points of B right#t& areb 0) b 91) b 19) b 0 ' The t*o sets of points are

    o+ser!ed to +e t*o edges of the triangle of control points #9&' Su+di!ision

    is one *ay of creating e"tra control points in order to gi!e additional

    freedom for cur!e design' 5or instance) one segment of the cur!e can +e

    left untouched *hile the other part of the cur!e is changed'

    Example )

    A B ier cu+ic B#t& has control points b 0#l'0)1'0&)b 1#9'0)7'0&)b 9#F'0' E'0&)

    and b #19'0' 9'0&' The control points of the t*o cur!e segments B left#t& and

    B right#t&) o+tained +y cutting B#t& at the parameter !alue t . 0'9 ) are

    determined from the triangle of points computed in K"ample F' B left#t& has

    control b 0#l'0)1'0&) b 1#1'9 )9' &) b 9#1'F19 ) ' E9 &) b #9' 7F) C'9 &)

    points and B right#t& has control points b 0#9' 7F) C'9 &) b 1#C'F7 ) E' 19 &)

    b 9# '0) '0&) b #19'0) 9'0&'

    0 a 1

    Theorem C #Su+di!ision&

  • 8/10/2019 Lec7Param

    15/23

  • 8/10/2019 Lec7Param

    16/23

    1* +en#ering

    To render a cur!e means to o+tain a plot of it' The main step of the

    rendering algorithm is an application of the de $astel(au algorithm to

    su+di!ide the cur!e'

    Step 1: Apply the de $astel(au algorithm *ith t . 1D9 to su+di!ide the

    Be ier cur!e into t*o cur!e segments denoted B left and B right

    Step 9: If B left is 6near linear@ #using the criterion descri+ed +elo*& then go

    to step N else) go to step 1 and apply the algorithm to B left' Similarly) if

    B right is near linear go to step N else go to step 1 and apply the algorithm to

    B right '

    The algorithm continues to su+di!ide the ne*ly o+tained cur!e segments

    *hich are not near linear' K!entually) the su+di!ision produces cur!e

    segments *hich are near linear and no further su+di!isions ta8e place'

    Step : The segment is near linear and can +e appro"imated +y its control

    polygon' ?ra* the control polygon'

  • 8/10/2019 Lec7Param

    17/23

    Kach time step is e"ecuted) the control polygon of a segment of the cur!e

    is dra*n' The union of all these control polygons gi!es a linear

    appro"imation of the original Be ier cur!e'

    Test to determine *hether a Be ier cur!e is near linear

    There are a num+er of *ays of deciding *hether or not a cur!e is close to

    +eing linear' Gne method requires the user to specify a tolerance O 0' 5or

    a plane cur!e) the control points are enclosed in a rectangle #see 5igure

    7#a&&) called a"in"ax 0ounding 0ox ) *ith lo*er left corner #" min) ymin& and

    upper right corner corner #" ma" ) yma" &) *here " minD"ma" ) is the

    minimumDma"imum ";coordinate of any control point) and y minDyma" ' is the

    minimumDma"imum y;coordinate of any control point' The cur!e is

    considered linear if the hori ontal or !ertical dimensions of the +o" are

    less than ' The smaller the tolerance the greater the num+er of

    su+di!isions computed) and the smoother the resulting appro"imation to

    the cur!e'

    A more sophisticated alternati!e is to determine the largest distance of any

    interior control point #i'e' a control point *hich is not an endpoint& from

    the line through the endpoints of the cur!e as sho*n) in 5igure 1C#+&' This

    is a more computationally e"pensi!e method than the minma" +o" method)

  • 8/10/2019 Lec7Param

    18/23

    +ut generally it *ill result in fe*er su+di!isions *hich *ill gi!e a sa!ing in

    computations'

    #a& Minma" +ounding +o" #+& Test for near linearity

    Figure 7 '

    A further impro!ement of the algorithm can +e o+tained +y su+di!iding at

    !alues other than t . 1D9' In general) the point B#1D9& is not e"actly half;

    *ay along the cur!e' So the algorithm could +e impro!ed if the su+di!isionta8es place nearer to half;*ay as this *ould reduce the num+er of

    su+di!isions' To determine the !alue of t *hich corresponds to half;*ay

    requires considera+le additional computation) and it is not o+!ious *hether

    this results in a more efficient algorithm'

    2* ,nterse!tion of a Planar Bzier Curve an# a -ine

    A planar B ier cur!e B#t& of degree n can intersect a line in the plane in

    up to n points' #It is assumed that B#t& is not a line segment and

  • 8/10/2019 Lec7Param

    19/23

    intersecting in an infinite set'& A simple algorithm to compute the points

    of intersection is as follo*s'

    Step 1: Test *hether the con!e" hull of the control points intersects the

    line #see +elo* for details&' If so) go to step 9 as there may +e an

    intersectionN else the cur!e does not intersect the line and the cur!e may +e

    disregarded'

    Step 9: Test to see if the cur!e is near linear' If so) go to step N else) apply

    the de $asteh(au algorithm to su+di!ide the cur!e into t*o Be ier cur!e

    segments and repeat step 1 *ith each segment'

    Step : The cur!e #or cur!e segment& is linear and may +e appro"imated

    +y a line segment #for e"ample) +y the line (oining the first and last control

    points&) and intersected *ith using the algorithm) implementing the

    lineDBesier intersection) and Be ier'Be ier intersection algorithms' The

    intersection is a point of intersection of the B ier cur!e and '

    Test to determine )*hether a con!e" hull intersects a line

  • 8/10/2019 Lec7Param

    20/23

  • 8/10/2019 Lec7Param

    21/23

    points' A simple algorithm to compute the intersection points of t*o B ier

    cur!es is as follo*s'

    Step 1: Test to see if the con!e" hulls of the control polygons intersect #see

    +elo* for details&' If so) go to step 9 as the cur!es may intersectN else the

    cur!es cannot intersect and may +e disregarded'

    Step 9: Test *hether the cur!es are linear' If so) go to step N else) apply

    the de $astel(au algorithm to su+di!ide each cur!e into t*o segments) and

    to gi!e a total of four pairs of cur!e segments' ,o to step 1 and apply the

    algorithm to each pair'

    Thus) each pair of su+di!ided cur!e segments is treated in a similar

    manner to the original pair' Kach su+di!ision produces cur!es *ith control

    points that ha!e successi!ely smaller con!e" hulls' The su+di!ision

    process *ill stop *hen the cur!e segments are near linear' Alternati!ely)

    the su+di!ision process could +e coded to stop after a fi"ed num+er of

    iterations #o+!iously *ith some loss of precision in the computation of the

    intersection points&'

  • 8/10/2019 Lec7Param

    22/23

    Step : Since +oth cur!es are near linear) the cur!es may +e appro"imated

    +y line segments #for e"ample) +y the line (oining the first and last control

    points&' The t*o linear segments are intersected #using the lineDBesier

    intersection) and Be ier'Be ier intersection algorithms& to determine the

    point of intersection of the t*o segments'

    Test to determine *hether t*o con!e" hulls are intersecting

    The simplest method is to enclose each con!e" hull in a minma" +ounding

    +o"' The t*o +o"es are easily chec8ed for o!erlap'

    Exer!ises

    E #optional& ?etermine algorithms *hich #a& appro"imate a nearly linear

    Be ier cur!e +y a line) and #II& determine the intersection of t*o linear

    segments' se the algorithms to implement the lineDBe ier intersection)

    and BQ ierDB ier intersection algorithms'

  • 8/10/2019 Lec7Param

    23/23

    (patial Bezier Curves

    A spatial Be ier cur!e B#t& .i

    n

    =

    0b iBi)n#t& is o+tained *hen the control

    points b i are three;dimensional' Spatial Be ier cur!es satisfy the properties

    of planar Be ier cur!es) namely) the endpoint interpolation and endpoint

    tangent conditions) in!ariance under affine transformations) the con!e" hull

    property #$%P&) and the !ariation diminishing property' In general) the

    con!e" hull of the set of control points is a !olume'

    The de $astel(au algorithm is e"ecuted in a similar manner to the t*o;

    dimensional case) e"cept that the linear interpolation is applied to three

    coordinates rather than t*o'

    +eferen!es

    ol' C) 1 CE) C ;