curve surface

Upload: ggire-yb

Post on 04-Jun-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/13/2019 Curve Surface

    1/43

    Representation of Curves &Surfaces

    Prof. Lizhuang Ma

    Shanghai Jiao Tong University

  • 8/13/2019 Curve Surface

    2/43

    Contents

    Specialized Modeling Techniques

    Polygon Meshes

    Parametric Cubic Curves Parametric Bi-Cubic Surfaces

    Quadric Surfaces

    Specialized Modeling Techniques

  • 8/13/2019 Curve Surface

    3/43

    The Teapot

  • 8/13/2019 Curve Surface

    4/43

    Representing Polygon Meshes

    Explicit representation

    By a list of vertex coordinates

    Pointers to a vertex list

    Pointers to an edge list

    )),,(),...,,,(),,,(( 222111 nnn zyxzyxzyxP

  • 8/13/2019 Curve Surface

    5/43

    Pointers to A Vertex List

    ),,,( 4321 VVVVV

    )),,(),...,,,(( 444111 zyxzyx

    )3,2,4(

    )4,2,1(

    2

    1

    P

    P

  • 8/13/2019 Curve Surface

    6/43

    Pointers to An Edge List

    ),,,( 4321 VVVVV

    )),,(),...,,,(( 444111 zyxzyx

    ),,(

    ),,(

    ),,,(

    ),,,(

    ),,,(

    ),,,(),,,(

    4322

    5411

    1145

    21244

    2433

    2322

    1211

    EEEP

    EEEP

    PVVE

    PPVVE

    PVVE

    PVVEPVVE

  • 8/13/2019 Curve Surface

    7/43

    Parametric Cubic Curves

    The cubic polynomials that define a curve

    segment are of the form:

    10)(

    )(

    )(

    ,

    23

    23

    23

    tdtctbtatz

    dtctbtaty

    dtctbtatx

    zzzz

    yyyy

    xxxx

    TtztytxtQ )]()()([)(

  • 8/13/2019 Curve Surface

    8/43

    Parametric Cubic Curves

    The curve segment can be rewrite as

    Where

    zzzz

    yyyy

    xxxx

    T

    dcba

    dcba

    dcba

    C

    tttT 123

    TCtztytxtQ T )]()()([)(

  • 8/13/2019 Curve Surface

    9/43

    Parametric Cubic Curves

  • 8/13/2019 Curve Surface

    10/43

    Tangent Vector

    Ttzdt

    dty

    dt

    dtx

    dt

    dtQtQ

    dt

    d)]()()([)()( '

    T

    ttCTCdt

    d

    ]123[ 2

    T

    zzzyyyxxx ctbtactbtactbta ]232323[ 222

  • 8/13/2019 Curve Surface

    11/43

    Continuity

    Between Curve Segments G0 geometric continuity

    Two curve segments join together

    G1 geometric continuity

    The directions (but not necessarily the magnitudes)

    of the two segments tangent vectors are equal at a

    join point

  • 8/13/2019 Curve Surface

    12/43

    Continuity

    Between Curve Segments C1 continuous

    The tangent vectors of the two cubic curve segments

    are equal (both directions and magnitudes) at thesegments joint point

    Cncontinuous

    The direction and magnitude of through

    the nth derivative are equal at the joint point

    )]([/ tQdtd nn

  • 8/13/2019 Curve Surface

    13/43

    Continuity

    Between Curve Segments

  • 8/13/2019 Curve Surface

    14/43

    Continuity

    Between Curve Segments

  • 8/13/2019 Curve Surface

    15/43

    Three Types of

    Parametric Cubic Curves

    Hermite Curves Defined by two endpoints and two endpoint tangent

    vectors Bzier Curves

    Defined by two endpoints and two control pointswhich control the endpoint tangent vectors

    Splines Defined by four control points

  • 8/13/2019 Curve Surface

    16/43

    Parametric Cubic Curves

    Representation:

    Rewrite the coefficient matrix as

    where Mis a 4x4 basis matrix, Gis called the

    geometry matrix So

    1)(

    )(

    )(

    )(2

    3

    44342414

    43332313

    42322212

    41312111

    4321t

    t

    t

    mmmm

    mmmm

    mmmm

    mmmm

    GGGG

    tz

    ty

    tx

    tQ

    TCtQ )(

    MGC

    4 endpoints or tangent vectors

  • 8/13/2019 Curve Surface

    17/43

    Parametric Cubic Curves

    Where is called the blending functions

    BGTMGtQ )(

    TMB

  • 8/13/2019 Curve Surface

    18/43

    Hermite Curves

    Given the endpointsP1andP4and tangent vectors atthemR1andR4

    What is Hermite basis matrix MH Hermite geometry vector GH Hermite blending functions BH

    By definition

    GH=[P1 P4 R1 R4]

  • 8/13/2019 Curve Surface

    19/43

    Hermite Curves

    Since

    THH

    T

    HH

    T

    HH

    T

    HH

    MGPQMGRQ

    MGPQ

    MGPQ

    0123)1(0100)0(

    1111)1(

    1000)0(

    4

    '

    1

    '

    4

    1

    0011

    1110

    2010

    3010

    4141 HHH MGRRPPG

  • 8/13/2019 Curve Surface

    20/43

    Hermite Curves

    So

    And

    0011

    0121

    0032

    1032

    0011

    1110

    2010

    3010 1

    HM

    TH tttttttttB 23232323 232132

    HHHH BGTMGtQ )(

  • 8/13/2019 Curve Surface

    21/43

    Given the endpointsP1andP4and two control

    pointsP2andP3which determine the endpoints

    tangent vectors, such that

    What is Bzier basis matrixMB Bzier geometry vector GB Bzier blending functionsBB

    Bzier Curves

    )(3)1(

    )(3)0(

    34

    '

    4

    12'

    1

    PPQR

    PPQR

  • 8/13/2019 Curve Surface

    22/43

    Bzier Curves

    By definition

    Then

    So

    HBB MGPPPP

    3011

    3000

    0300

    0301

    4321

    4321 PPPPGB

    4141 RRPPGH

    TMMGTMGtQHHBBHH

    )()(

    TMGTMMG BBHHBB )(

  • 8/13/2019 Curve Surface

    23/43

    Bzier Curves

    And

    HBBHHBB MGMMM

    0001

    0033

    0363

    1331

    4

    3

    3

    2

    2

    2

    1

    3 )1(3)1(3)1()( PtPttPttPttQ

    T

    ttttttBB 3223

    )1(3)1(3)1( (Bernstein polynomials)

  • 8/13/2019 Curve Surface

    24/43

    Convex Hull

  • 8/13/2019 Curve Surface

    25/43

    The polynomial coefficients for natural cubic

    splines are dependent on all n control points

    Has one more degree of continuity than is inherent inthe Hermite and Bzier forms

    Moving any one control point affects the entire curve

    The computation time needed to invert the matrix can

    interfere with rapid interactive reshaping of a curve

    Spline

  • 8/13/2019 Curve Surface

    26/43

    B-Spline

  • 8/13/2019 Curve Surface

    27/43

    Cubic B-Spline

    Has m+1control points

    Has m-2cubic polynomial curve segments

    Uniform The knots are spaced at equal intervals of the

    parameter t Non-rational Not rational cubic polynomial curves

    Uniform NonRational B-Splines

    3,,..., 10 mPPP m

    mQQQ ,...,, 43

  • 8/13/2019 Curve Surface

    28/43

    Curve segment Qi is defined by points

    B-Spline geometry matrix

    If Then

    Uniform NonRational B-Splines

    iiii PPPP ,,, 223

    miPPPPG iiiiBSi 3,123

    T

    iiii ttttttT 1)()()(

    23

    1,)( iiiBsBsii tttTMGtQ

  • 8/13/2019 Curve Surface

    29/43

    So B-Spline basis matrix

    B-Spline blending functions

    Uniform NonRational B-Splines

    TBs tttttttB 323233 1333463)1(6

    1

    0001

    1333

    4063

    1331

    6

    1BsM

  • 8/13/2019 Curve Surface

    30/43

    The knot-value sequence is a nondecreasing

    sequence

    Allow multiple knot and the number of identical

    parameter is the multiplicity Ex. (0,0,0,0,1,1,2,3,4,4,5,5,5,5)

    So

    Uniform NonRational B-Splines

    )()()()()( 4,4,114,224,33 tBPtBPtBPtBPtQ iiiiiiiii

  • 8/13/2019 Curve Surface

    31/43

    Uniform NonRational B-Splines

    Where isj th-order blending function for

    weighting control pointPi

    )()()(

    )()()(

    )()()(

    ,0

    ,1)(

    3,1

    14

    43,

    3

    4,

    2,1

    13

    32,

    2

    3,

    1,1

    12

    21,

    1

    2,

    1

    1,

    tBtt

    tttB

    tt

    tttB

    tB

    tt

    tttB

    tt

    tttB

    tBtt

    tttB

    tt

    tttB

    otherwise

    ttttB

    i

    ii

    ii

    ii

    ii

    i

    ii

    ii

    ii

    ii

    i

    ii

    ii

    ii

    ii

    ii

    i

    )(, tB ji

  • 8/13/2019 Curve Surface

    32/43

    Knot Multiplicity & Continuity

    Since is within the convex hull of and

    If is within the convex hull of ,

    and and the convex hull of and ,so it

    will lie on If will lie on

    If will lie on both and , and the

    curve becomes broken

    )( itQ 23 , ii PP 1iP

    )(,1 iii tQtt 23, ii PP

    1iP 12 , ii PP 1iP

    12 ii PP

    )(,21 iiii tQttt 1iP

    )(,321 iiiii tQtttt 1iP iP

  • 8/13/2019 Curve Surface

    33/43

    Multiplicity 1 : C2 continuity

    Multiplicity 2 : C1 continuity

    Multiplicity 3 : C0 continuity Multiplicity 4 : no continuity

    Knot Multiplicity & Continuity

  • 8/13/2019 Curve Surface

    34/43

    NURBS:

    NonUniform Rational B-Splines

    Rational

    and are defined as the ratio of two

    cubic polynomials

    Rational cubic polynomial curve segments areratios of polynomials

    Can be Bzier, Hermite, or B-Splines

    ),(),( tytx

    )(

    )()(

    tW

    tXtx

    )(tz

    )(

    )()(

    tW

    tYty

    )(

    )()(

    tW

    tZtz

  • 8/13/2019 Curve Surface

    35/43

    Parametric Bi-Cubic Surfaces

    Parametric cubic curves are

    So, parametric bi-cubic surfaces are

    If we allow the points in Gto vary in 3D along

    some path, then

    Since are cubics:

    , where

    SMtGtGtGtGtsQ )()()()(,( 4321

    TMGtQ )(

    SMGtQ )(

    )(tGi

    TMGtGi )( 4321 iiiii ggggG

  • 8/13/2019 Curve Surface

    36/43

    Parametric Bi-Cubic Surfaces

    So

    SM

    gggg

    gggg

    gggg

    gggg

    MTtsQ TT

    44342414

    43332313

    42322212

    41313211

    ),(

    1,0, tsSMGMT TT

  • 8/13/2019 Curve Surface

    37/43

    Hermite Surfaces

    SMGMTtsQ HHT

    H

    T ),( TMGtRtRtPtP HH ()()( 4141

  • 8/13/2019 Curve Surface

    38/43

    Bzier Surfaces

    SMGMTtsQ BsBsT

    Bs

    T ),(

  • 8/13/2019 Curve Surface

    39/43

    Normals to Surfaces

    Ss

    MGMTtsQs

    TT

    ),(

    TTT ssMGMT 0123 2

    SMGMTt

    tsQs

    TT

    )(),(

    SMGMss TT 0123 2

    ),(),( tsQt

    tsQs

    normal vector

  • 8/13/2019 Curve Surface

    40/43

    Quadric Surfaces

    Implicit surface equation

    An alternative representation

    with

    0 PQPT

    0222222),,( 222 kjzhygxfxzeyzdxyczbyaxzyxf

    1

    z

    yx

    P

    kjhg

    jcef

    hebdgfda

    Q

  • 8/13/2019 Curve Surface

    41/43

    Advantages:

    Computing the surface normal

    Testing whether a point is on the surface Computingzgivenxandy

    Calculating intersections of one surface with another

    Quadric Surfaces

  • 8/13/2019 Curve Surface

    42/43

    Fractal Models

  • 8/13/2019 Curve Surface

    43/43

    Grammar-Based Models

    L-grammars

    A -> AA

    B -> A[B]AA[B]