86
5. Curves and Curve Modeling Yrd.Doç.Dr. Ahmet Zafer Şenalp email: [email protected] Makine Mühendisliği Bölümü Gebze Yüksek Teknoloji Enstitüsü ME 521 Computer Aided Design

ME 521 Computer Aided Design 5. Curves and Curve Modelingabl.gtu.edu.tr/hebe/AblDrive/66500040/w/Storage/109_2010_2_521... · ME 521. Computer Aided Design. ¾Curves are the basics

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

  • 5. Curves and Curve Modeling

    Yrd.Doç.Dr. Ahmet Zafer Şenalpe‐mail: [email protected]

    Makine Mühendisliği Bölümü

    Gebze Yüksek Teknoloji Enstitüsü

    ME 521Computer Aided Design

    mailto:[email protected]

  • Curves are the basics for surfaces

    Before learning surfaces curves have to  be known

    When asked to modify a particular entity on a CAD system, knowledge of the entities can increase your productivity

    Understand how the math presentation of various curve entities relates to a user interface

    Understand what is impossible and which way can be more efficient when creating or modifying an entity

    Dr. Ahmet Zafer Şenalp ME 521 2GYTE-Makine Mühendisliği Bölümü

    5. Curves and Curve Modeling

  • Curves are the basics for surfaces

    Dr. Ahmet Zafer Şenalp ME 521 3GYTE-Makine Mühendisliği Bölümü

    5. Curves and Curve Modeling

  • Why Not Simply Use a Point Matrix toRepresent a Curve?

    Storage issue and limited resolution

    Computation and transformation

    Difficulties in calculating the intersections or curves and physical properties of objects

    Difficulties in design (e.g. control shapes of an existing object)

    Poor surface finish of manufactured parts

    Dr. Ahmet Zafer Şenalp ME 521 4GYTE-Makine Mühendisliği Bölümü

    5. Curves and Curve Modeling

  • Advantages of AnalyticalRepresentation for Geometric Entities

    A few parameters to store

    Designers know the effect of data points on curve behavior, control, continuity, and curvature

    Facilitate calculations of intersections, object properties, etc.

    Dr. Ahmet Zafer Şenalp ME 521 5GYTE-Makine Mühendisliği Bölümü

    5. Curves and Curve Modeling

  • Curve Definitions

    Explicit form :

    Implicit form :

    cmxy +=

    0=++ cbyax

    Dr. Ahmet Zafer Şenalp ME 521 6GYTE-Makine Mühendisliği Bölümü

    5. Curves and Curve Modeling

  • Drawbacks of Conventional Representations

    Geleneksel açık (explicit) ve kapalı (implicit) formların sakıncaları vardır.

    The represent unbounded geometry

    They may be multi‐valued

    Difficult to evaluate points along the curve

    Depends on coordinate system

    Dr. Ahmet Zafer Şenalp ME 521 7GYTE-Makine Mühendisliği Bölümü

    5. Curves and Curve Modeling

  • Parametric Representation

    Curves are defined as a function of a single parameter:

    )u(zz),u(yy),u(xxand

    P(u)P

    ===

    =

    Dr. Ahmet Zafer Şenalp ME 521 8GYTE-Makine Mühendisliği Bölümü

    5. Curves and Curve Modeling

  • u

    u

    v

    Curve, P=P(u)Surface, P=P(u,v)

    P(u)=[x(u),y(u),z(u)]T

    P(u, v)=[x(u, v), y(u, v), z(u, v)]T

    Parametric Representation

    Dr. Ahmet Zafer ŞenalpME 521 9GYTE-Makine Mühendisliği Bölümü

    5. Curves and Curve Modeling

  • Parametric Representation

    Changing curve equation into parametric form:

    2xy =Let’s use “t” parameter ;

    2

    2

    )()()(

    ttyyttxx

    tPP

    tytx

    ==

    ===

    =

    =

    )u(zz),u(yy),u(xxand

    P(u)P

    ===

    =

    Dr. Ahmet Zafer Şenalp ME 521 10GYTE-Makine Mühendisliği Bölümü

    5. Curves and Curve Modeling

  • Parametric Explicit Form‐Implicit Form ConversionExample :

    Planar 2. degree curve: 

    How to obtain implicit form?

    t is extracted as:

    Replacing t in y equation;

    Rearranging the above equation;

    Rearranging again;

    We obtain implicit form.

    22y 1

    2

    2

    +−=

    −=

    tttx

    1+±= xt

    ( ) 212 1 2 ++±+= xxy

    [ ] ( )22 122)1( +±=−+− xxy

    05622 22 =+−++− yxyxyx

    Dr. Ahmet Zafer Şenalp ME 521 11GYTE-Makine Mühendisliği Bölümü

    5. Curves and Curve Modeling

  • Parametric Explicit Form‐Implicit Form ConversionExample :

    Planar 2. degree curve : 

    22y 1

    2

    2

    +−=

    −=

    tttx

    0

    2

    4

    6

    8

    10

    12

    ‐2 ‐1 0 1 2 3 4X

    Y

    [ ]2,2−∈t plot

    Dr. Ahmet Zafer Şenalp ME 521 12GYTE-Makine Mühendisliği Bölümü

    5. Curves and Curve Modeling

  • Curve Classification

    Curve Classification:

    Analytic Curves

    Synthetic curves

    Dr. Ahmet Zafer Şenalp ME 521 13GYTE-Makine Mühendisliği Bölümü

    5. Curves and Curve Modeling

  • Analytic Curves

    These curves have an analytic equation

    point

    line

    arc

    circle

    fillet

    Chamfer

    Conics (ellipse, parabola,and hyperbola))

    Dr. Ahmet Zafer Şenalp ME 521 14GYTE-Makine Mühendisliği Bölümü

    5. Curves and Curve Modeling

  • line arc

    circle

    Forming Geometry withAnalytic Curves

    Dr. Ahmet Zafer Şenalp ME 521 15GYTE-Makine Mühendisliği Bölümü

    5. Curves and Curve Modeling

  • Analytic CurvesLine

    Line definition in cartesian coordinate system:

    Here;m: slope of the lineb: point that intersects y axisx: independent varaible of y function.

    Parametric form;

    Dr. Ahmet Zafer Şenalp ME 521 16GYTE-Makine Mühendisliği Bölümü

    5. Curves and Curve Modeling

  • Analytic CurvesLineExample:implicit‐explicit form change

    Line equation:

    Parametric line equation is obtained. 

    To turn back to implicit or explicit nonparametric form t is repaced in x and y equalities

    12 −= xy

    012 =−− yx implicit form

    explicit form

    12)1(1

    +=++=

    tyty

    tx

    Changing to parametric form. In this case )();( tyytxx ==

    Let . Replacing this value to y equation. 

    İs obtained.

    As a result;

    121+=

    +=ty

    tx

    1)1(21

    +−=−=xy

    xt

    From here the form at the beginning is obtained.Dr. Ahmet Zafer Şenalp ME 521 17GYTE-Makine Mühendisliği Bölümü

    5. Curves and Curve Modeling

  • Analytic CurvesCircle

    Circle definition in Cartesian coordinate system:

    Here;a,b: x,y coordinates of center pointr: circle radius

    Parametric form 

    Dr. Ahmet Zafer Şenalp ME 521 18GYTE-Makine Mühendisliği Bölümü

    5. Curves and Curve Modeling

    http://en.wikipedia.org/wiki/Image:Circle_center_a_b_radius_r.svg

  • Analytic CurvesEllipse

    Ellipse definition in Cartesian coordinate system:

    Here;h,k: x,y coordinates of center pointa: radius of major axisb: radius of minör exis

    Parametric form 

    Dr. Ahmet Zafer Şenalp ME 521 19GYTE-Makine Mühendisliği Bölümü

    5. Curves and Curve Modeling

    http://en.wikipedia.org/wiki/Image:Ellipse_as_hypotrochoid.gif

  • Analytic CurvesParabola

    Parabola definition in Cartesian coordinate system:

    Usual form;

    y = ax2 + bx + c

    0

    2

    4

    6

    8

    10

    12

    14

    16

    18

    ‐6 ‐4 ‐2 0 2 4 6X

    Y

    Dr. Ahmet Zafer Şenalp ME 521 20GYTE-Makine Mühendisliği Bölümü

    5. Curves and Curve Modeling

  • Analytic CurvesHyperbola

    Hyperbola definition in Cartesian coordinate system:

    Dr. Ahmet Zafer Şenalp ME 521 21GYTE-Makine Mühendisliği Bölümü

    5. Curves and Curve Modeling

    http://en.wikipedia.org/wiki/Image:Hyperbola.pnghttp://upload.wikimedia.org/wikipedia/commons/7/74/Drini-conjugatehyperbolas.png

  • Synthetic Curves

    As the name implies these are artificial curves

    Lagrange interpolation curves

    Hermite interpolation curves

    Bezier

    B‐Spline

    NURBS

    etc.

    Analytic curves are usually not sufficient to meet geometric design requirements of mechanical parts.

    Many products need free‐form, or synthetic curved surfaces

    These curves use a series of control points either interploated or aproximated

    It is the definition methos for complex curves.

    It should be controllable by the designer.

    Calculation and storage should be easy.

    At the same time called as free form curves.Dr. Ahmet Zafer Şenalp ME 521 22GYTE-Makine Mühendisliği Bölümü

    5. Curves and Curve Modeling

  • Synthetic Curves

    open currve

    closed curve

    Dr. Ahmet Zafer Şenalp ME 521 23GYTE-Makine Mühendisliği Bölümü

    5. Curves and Curve Modeling

  • interpolated

    approximated

    control points

    Synthetic Curves

    Dr. Ahmet Zafer Şenalp ME 521 24GYTE-Makine Mühendisliği Bölümü

    5. Curves and Curve Modeling

  • Composite Curves

    Curves can be represented by connected segments to form a composite curve

    There must be continuity at the mid‐points

    1 2 34

    Dr. Ahmet Zafer Şenalp ME 521 25GYTE-Makine Mühendisliği Bölümü

    5. Curves and Curve Modeling

  • Degrees of Continuity

    Position continuity

    Slope continuity

    1st derivative

    Curvature continuity

    2nd derivative 

    • Higher derivatives as necessary

    Dr. Ahmet Zafer Şenalp ME 521 26GYTE-Makine Mühendisliği Bölümü

    5. Curves and Curve Modeling

  • Position Continuity

    1 2

    3

    Connected (C0 continuity)

    Mid‐points are connected

    Dr. Ahmet Zafer Şenalp ME 521 27GYTE-Makine Mühendisliği Bölümü

    5. Curves and Curve Modeling

  • Slope Continuity

    1

    2

    Continuous tangent

    Tangent continuity (C1 continuity)

    Both curves have the same 1. derivative  value at the connection point. At the same time position continuity is also attained.

    Dr. Ahmet Zafer Şenalp ME 521 28GYTE-Makine Mühendisliği Bölümü

    5. Curves and Curve Modeling

  • Continuous curvature

    Curvature continuity (C2 continuity)

    12

    Curvature Continuity

    Both curves have the same 2.derivative value at the connection point.At the same time position and slope continuity is also attained.

    Dr. Ahmet Zafer Şenalp ME 521 29GYTE-Makine Mühendisliği Bölümü

    5. Curves and Curve Modeling

  • Composite Curves

    A cubic spline has C2 continuity at intermediate points

    Cubic splines do not allow local control

    12

    3

    4

    Cubic polynomials

    Dr. Ahmet Zafer Şenalp ME 521 30GYTE-Makine Mühendisliği Bölümü

  • Linear Interpolation

    General Linear Interpolation:

    One of the simplest method is linear interpolation. 

    Dr. Ahmet Zafer Şenalp ME 521 31GYTE-Makine Mühendisliği Bölümü

    5. Curves and Curve Modeling

    http://upload.wikimedia.org/wikipedia/commons/6/67/Interpolation_example_linear.svg

  • Parametric Cubic Polynomial Curves

    Cubic polynomials are the lowest‐order polynomials that can represent a non‐planar curve

    The curve can be defined by 4 boundary conditions

    33

    2210)(P uuuu kkkk +++=

    Dr. Ahmet Zafer Şenalp ME 521 32GYTE-Makine Mühendisliği Bölümü

    5. Curves and Curve Modeling

  • Cubic Polynomials

    Lagrange interpolation ‐ 4 points

    Hermite interpolation ‐ 2 points, 2 slopes

    p0

    p3

    p2

    p1

    Lagrangep0

    p1

    P1’P0’

    Hermite

    Dr. Ahmet Zafer Şenalp ME 521 33GYTE-Makine Mühendisliği Bölümü

    5. Curves and Curve Modeling

  • Lagrange Interpolation

    2 xi terms should not be the same,

    For N+1 data points ; (x0,y0),...,(xN,yN) için

    Lagrange  interpolation form is in the form of linear combination:

    l j(x) =( )( )∏

    ≠= −

    −N

    ji0i ij

    i

    xxxx = ( ) ( )( ) ( )( ) ( )( ) ( )Nj2j1j0j

    N210

    xx.............xxxxxxxx.............xxxxxx−−−−−−−−

    L(x)=l1(x) y1+ l2(x) y2+...................... lN(x) yN = jN

    0jj y)x(∑

    =

    l

    Below polynomial is called Lagrange base polynomial;

    Dr. Ahmet Zafer Şenalp ME 521 34GYTE-Makine Mühendisliği Bölümü

    5. Curves and Curve Modeling

  • Lagrange Interpolation

    This image shows, for four points ((−9, 5), (−4, 2), (−1, −2), (7, 9)), the (cubic) interpolation polynomial 

    L(x) (in black), which is the sum of the scaled basis polynomials y0ℓ0(x), y1ℓ1(x), y2ℓ2(x) and y3ℓ3(x). The interpolation polynomial passes through all four control points, and each scaled basis polynomial passes through its respective control point and is 0 where x corresponds to the other three control points

    Dr. Ahmet Zafer Şenalp ME 521 35GYTE-Makine Mühendisliği Bölümü

    5. Curves and Curve Modeling

    http://upload.wikimedia.org/wikipedia/commons/f/f0/Lagrangepolys.png

  • Lagrange InterpolationExample:

    A 3. degree L(x) function has the following x and corresponding y values;

    x= 0 1 2 3 4 y= 8 6 -6 -9 -1

    ( ) ( )( ) ( )( ) ( )( )( ) =−−−−

    −−−−403020104x3x2x1x

    2424x50x35x10x 234 +−+−

    �1(x)=

    ( ) ( )( ) ( )( ) ( )( )( ) =−−−−

    −−−−413121014x3x2x0x

    6x24x26x9x 234 −+−

    −�2(x)=

    ( ) ( )( ) ( )( ) ( )( )( ) =−−−−

    −−−−423212024x3x1x0x

    4x12x19x8x 234 −+−

    �3(x)=

    ( ) ( )( ) ( )( ) ( )( )( ) =−−−−

    −−−−432313034x2x1x0x

    6x8x14x7x 234 −+−

    −�4(x)=

    ( ) ( )( ) ( )( ) ( )( )( ) =−−−−

    −−−−342414043x2x1x0x

    24x6x11x6x 234 −+−

    �5(x)=

    The polynomial corresponding to the above values can be determined by Lagrange interpolation method: 

    L(x)=8l1(x)+6l2(x)‐6l3(x)‐9l4(x)‐l5(x)

    Dr. Ahmet Zafer Şenalp ME 521 36GYTE-Makine Mühendisliği Bölümü

    5. Curves and Curve Modeling

  • Lagrange InterpolationExample:

    obtained.

    L(x)= ‐0,7083x4+7,4167x3‐22,2917x2+13,5833x+8

    Dr. Ahmet Zafer Şenalp ME 521 37GYTE-Makine Mühendisliği Bölümü

    5. Curves and Curve Modeling

  • Cubic Hermite Interpolation

    There are no algebraic coefficints but there are geometric coefficints

    Position vector at the starting point

    Position vector at the end point

    Tangent  vector at the starting point

    Tangent  vector at the starting point

    General form of Cubic Hermite interpolation:

    Also known as cubic splines.Enables up to C1 continuity.

    Dr. Ahmet Zafer Şenalp ME 521 38GYTE-Makine Mühendisliği Bölümü

    5. Curves and Curve Modeling

  • Cubic Hermite Interpolation

    Hermite base functions

    Hermite form is obtained by the linear summation of this 4 function at each interval. 

    Dr. Ahmet Zafer Şenalp ME 521 39GYTE-Makine Mühendisliği Bölümü

  • Cubic Hermite Interpolation

    The effect of tangent vector to the curve shape

    Geometrik katsayı matrisi

    Geometric coefficient matrix controls the shape of the curve.

    Dr. Ahmet Zafer Şenalp ME 521 40GYTE-Makine Mühendisliği Bölümü

  • Cubic Hermite Interpolation

    Hermite curve set with same end points (P0 ve P1), Tangent vectors P0’ and P1’ have the same directions but  P0’  have different magnitude P1’ is constant

    P0

    P0’

    P2

    T2

    Dr. Ahmet Zafer Şenalp ME 521 41GYTE-Makine Mühendisliği Bölümü

  • Cubic Hermite Interpolation

    All tangent vector magnitudes are equal but the direction of left tangent vector changes.

    Dr. Ahmet Zafer Şenalp ME 521 42GYTE-Makine Mühendisliği Bölümü

  • Cubic Hermite Interpolation

    There are no algebraic coefficints but there are geometric coefficints

    Cubic Hermite interpolation form:

    Dr. Ahmet Zafer Şenalp ME 521 43GYTE-Makine Mühendisliği Bölümü

    5. Curves and Curve Modeling

    Can also be written as:

    [ ]⎥⎥⎥⎥

    ⎢⎢⎢⎢

    ′′

    ⎥⎥⎥⎥

    ⎢⎢⎢⎢

    ⎡−−

    =

    1

    0

    1

    0

    23

    PPPP

    0001010012331122

    1uuu)u(P

  • Approximated Curves

    Bezier

    B‐Spline 

    NURBS

    etc.

    Dr. Ahmet Zafer Şenalp ME 521 44GYTE-Makine Mühendisliği Bölümü

  • Bezier Curves

    P. Bezier of the French automobile company of Renault first introduced the Bezier curve (1962). 

    Bezier curves were developed to allow more convenient manipulation of curves

    A system for designing sculptured surfaces of automobile bodies (based on the Bezier curve)

    A Bezier curve is a polynomial curve approximating a control polygon

    Quadratic and cubic Bézier curves are most common

    Higher degree curves are more expensive to evaluate.

    When more complex shapes are needed, low order Bézier curves are patched together.

    Bézier curves are easily programmable. Bezier curves are widely used in computer graphics. 

    Enables up to C1 continuity.

    Dr. Ahmet Zafer Şenalp ME 521 45GYTE-Makine Mühendisliği Bölümü

  • Control polygon

    Bezier Curves

    Dr. Ahmet Zafer Şenalp ME 521 46GYTE-Makine Mühendisliği Bölümü

  • Bezier Curves

    Dr. Ahmet Zafer Şenalp ME 521 47GYTE-Makine Mühendisliği Bölümü

  • Bezier Curves

    where the polynomials

    are known as Bernstein basis polynomials of degree n, defining t0 = 1 and (1 ‐ t)0 = 1.

    General Bezier curve form which is controlled by n+1 Pi control points;

    : binomial coefficient.

    Degree of polynomial is one less than the control points used.Dr. Ahmet Zafer Şenalp ME 521 48GYTE-Makine Mühendisliği Bölümü

    http://en.wikipedia.org/wiki/Bernstein_polynomialhttp://en.wikipedia.org/wiki/Binomial_coefficient

  • The points Pi are called control points for the Bézier curve

    The polygon formed by connecting the Bézier points with lines, starting with P0 and finishing with Pn, is called the Bézier polygon (or control polygon). The convex hull of the Bézier polygon contains the Bézier curve.

    The curve begins at P0 and ends at Pn; this is the so‐called endpoint interpolation property. 

    The curve is a straight line if and only if all the control points are collinear. 

    The start (end) of the curve is tangent to the first (last) section of the Bézier polygon. 

    A curve can be split at any point into 2 subcurves, or into arbitrarily many subcurves, each of which is also a Bézier curve. 

    Dr. Ahmet Zafer Şenalp ME 521 49GYTE-Makine Mühendisliği Bölümü

    http://en.wikipedia.org/wiki/Polygon

  • Bezier CurvesLinear Curves

    t= [0,1] form of a linear Bézier curve turns out to be linear interpolloation form.

    Curve passes through points P0 ve P1.

    Animation of a linear Bézier curve, t in [0,1]. The t in the function for a linear Béziercurve can be thought of as describing how far B(t) is from P0 to P1.

    For example when t=0.25, B(t) is one quarter of the way from point P0 to P1. As t variesfrom 0 to 1, B(t) describes a curved line from P0 to P1.

    Dr. Ahmet Zafer Şenalp ME 521 50GYTE-Makine Mühendisliği Bölümü

  • Bezier CurvesQuadratic Curves

    For quadratic Bézier curves one can construct intermediate points Q0 and Q1 such that as t varies from 0 to 1:

    Point Q0 varies from P0 to P1 and describes a linear Bézier curve.

    Point Q1 varies from P1 to P2 and describes a linear Bézier curve.

    Point B(t) varies from Q0 to Q1 and describes a quadratic Bézier curve. 

    Curve passes through P0 , P1 & P2 points.

    Dr. Ahmet Zafer Şenalp ME 521 51GYTE-Makine Mühendisliği Bölümü

  • Bezier CurvesHigher Order Curves

    For higher‐order curves one needs correspondingly more intermediate points.

    Cubic Bezier Curve

    Curve passes through P0 , P1, P2 & P3 points.

    For cubic curves one can construct intermediate points Q0, Q1 & Q2 that describe linear Bézier curves, and points R0 & R1 that describe quadratic Bézier curves 

    Dr. Ahmet Zafer Şenalp ME 521 52GYTE-Makine Mühendisliği Bölümü

    http://en.wikipedia.org/wiki/Image:Bezier_3_big.png

  • Bezier CurvesBernstein Polynomials

    Most of the graphics packages confine Bézier curve with only 4 control points. Hence n = 3 .

    43

    323

    223

    123

    PtP)t3t3(

    P)t3t6t3(P)1t3t3t()t(Q

    ++−

    ++−

    ++−+−=

    Bernstein polinomials

    t

    f(t)1

    1

    BB1 BB4

    BB2 BB3

    2B )t1(t3B 2 −=

    3B tB 4 =

    3B )t1(B 1 −=

    )t1(t3B 2B3 −=Dr. Ahmet Zafer Şenalp ME 521 53GYTE-Makine Mühendisliği Bölümü

  • Bezier CurvesHigher Order Curves

    Fourth Order Bezier Curve

    Curve passes through P0 , P1, P2, P3 & P4 points.

    For fourth‐order curves one can construct intermediate points Q0, Q1, Q2 & Q3 that describe linear Bézier curves, points R0, R1 & R2 that describe quadratic Béziercurves, and points S0 & S1 that describe cubic Bézier curves:

    Dr. Ahmet Zafer Şenalp ME 521 54GYTE-Makine Mühendisliği Bölümü

    http://en.wikipedia.org/wiki/Image:Bezier_4_big.png

  • Bezier CurvesPolinomial Form

    Sometimes it is desirable to express the Bézier curve as a polynomial instead of a sum of less straightforward Bernstein polynomials. Application of the binomial theorem to the definition of the curve followed by some rearrangement will yield:

    ve

    This could be practical if Cj can be computed prior to many evaluations of B(t); however one should use caution as high order curves may lack numeric stability (de Casteljau's algorithm should be used if this occurs). 

    Dr. Ahmet Zafer Şenalp ME 521 55GYTE-Makine Mühendisliği Bölümü

    http://en.wikipedia.org/wiki/Polynomialhttp://en.wikipedia.org/wiki/Bernstein_polynomialhttp://en.wikipedia.org/wiki/Binomial_theoremhttp://en.wikipedia.org/wiki/Numeric_stabilityhttp://en.wikipedia.org/wiki/De_Casteljau's_algorithmhttp://en.wikipedia.org/wiki/De_Casteljau's_algorithm

  • Bezier CurvesExample:

    Coordinatess of 4 control poits are given as:

    What is the equation of Bezier curve that will be obtained by using above points?What are the coordinate values on the curve corresponding to t=0,1/4,2/4,3/4,1 ?

    Solution: For 4 points 3. order Bezier form is used:

    [ ]1,0,)1(3)1(3)1()( 33221203 ∈+−+−+−= tPtPttPttPttB[ ]ToPB 022)0( ==

    [ ]TPPPPB 056,215,2641

    649

    6427

    6427)

    41( 3210 =+++=

    [ ]TPPPPB 075,250,281

    83

    83

    81)

    42( 3210 =+++=

    [ ]TPPPPB 056,284,26427

    6427

    649

    641)

    43( 3210 =+++=

    [ ]TPB 023)1( 3 ==

    Points on B(t) curve

    : Bezier curve equation

    Dr. Ahmet Zafer Şenalp ME 521 56GYTE-Makine Mühendisliği Bölümü

  • Bezier CurvesExample:

    Equation of Bezier curve:

    ⎥⎥⎥

    ⎢⎢⎢

    ⎡+

    ⎥⎥⎥

    ⎢⎢⎢

    ⎡−+

    ⎥⎥⎥

    ⎢⎢⎢

    ⎡−+

    ⎥⎥⎥

    ⎢⎢⎢

    ⎡−=

    023

    033

    )1(3032

    )1(3022

    )1()( 3223 tttttttB

    Control pointsPoints on B(t) curve

    Dr. Ahmet Zafer Şenalp ME 521 57GYTE-Makine Mühendisliği Bölümü

  • Bezier CurvesDisadvantages

    Difficult to interpolate points

    Cannot locally modify a Bezier curve

    Dr. Ahmet Zafer Şenalp ME 521 58GYTE-Makine Mühendisliği Bölümü

  • Bezier CurvesGlobal Change

    Dr. Ahmet Zafer Şenalp ME 521 59GYTE-Makine Mühendisliği Bölümü

  • Bezier CurvesLocal Change

    Dr. Ahmet Zafer Şenalp ME 521 60GYTE-Makine Mühendisliği Bölümü

  • Bezier CurvesExample

    2 cubic composite Bézier curve ‐ 6. order Bézier curvecomparisson

    Dr. Ahmet Zafer Şenalp ME 521 61GYTE-Makine Mühendisliği Bölümü

  • Bezier CurvesModeling Example

    Contains 32 curve

    Polygon representation

    Dr. Ahmet Zafer Şenalp ME 521 62GYTE-Makine Mühendisliği Bölümü

  • B‐Spline Curves

    B‐splines are generalizations of Bezier curves

    A major advantage is that they allow local control

    B‐spline is a spline function that has minimal support with respect to a given degree, smoothness, and domain partition. 

    A fundamental theorem states that every spline function of a given degree, smoothness, and domain partition, can be represented as a linear combination of B‐splines of that same degree and smoothness, and over that same partition.

    The term B‐spline was coined by Isaac Jacob Schoenberg and is short for basis spline. B‐splines can be evaluated in a numerically stable way by the de Boor algorithm.

    A B‐spline is simply a generalisation of a Bézier curve, and it can avoid the Runge phenomenon without increasing the degree of the B‐spline.The degree of curve obtained is independent of number of control points.

    Enables up to C2 continuity.

    Dr. Ahmet Zafer Şenalp ME 521 63GYTE-Makine Mühendisliği Bölümü

    http://en.wikipedia.org/wiki/Degree_of_a_polynomial

  • B‐Spline Curves

    Pi defines B‐Spline curve with given n+1 control points:

    Here Ni,k(u) is B‐Spline functions proposed by Cox ve de Boor tarafından in 1972.

    k parameter controls B‐Spline curve degree (k‐1) and generally independent of number of control points.

    ui is called parametric knots or (knot vales) for an open curve B‐Spline:

    aksi durumda

    Dr. Ahmet Zafer Şenalp ME 521 64GYTE-Makine Mühendisliği Bölümü

  • This ineequality shows that;for linear curve at least 2for 2. degree curve at least 3for cubic curve at least 4 control points are necessary.

    B‐Spline Curves

    if a curve with (k-1) degree and ( n+1) control points is to be developed, (n+k+1) knots thenare required.

    Dr. Ahmet Zafer Şenalp ME 521 65GYTE-Makine Mühendisliği Bölümü

  • Linear functionk=2

    B‐Spline Curves

    Below figures show B‐Spline functions:

    2. degree functionk=3

    cubic functionk=4

    Dr. Ahmet Zafer Şenalp ME 521 66GYTE-Makine Mühendisliği Bölümü

  • Number of control points is independent than the degree of the polynomial.

    B‐Spline CurvesProperties

    The higher the order of the B‐Spline, the less the influence the closecontrol point

    Lineark=2

    vertex

    Quadratic B‐Spline; k=3Cubic B‐Spline; k=4

    Fourth Order B‐Spline; k=5

    n=3

    vertex

    vertex

    vertex

    Dr. Ahmet Zafer Şenalp ME 521 67GYTE-Makine Mühendisliği Bölümü

  • B‐spline allows better local control. Shape of the curvecan be adjusted by moving the control points. Local control: a control point only influences k segments.

    B‐Spline CurvesProperties

    Dr. Ahmet Zafer Şenalp ME 521 68GYTE-Makine Mühendisliği Bölümü

  • B‐Spline CurvesExample:

    Cubic Spline; k=4, n=38 knots are required.

    Limits of u parameter:Bezier curve equality;

    reminder :

    Equation results 8 knots

    reminder : To define a (k‐1) degree curve with (n+1) control points (n+k+1) knots are required. 

    B‐Spline vector can be calculated together with knot vector;

    *

    Dr. Ahmet Zafer Şenalp ME 521 69GYTE-Makine Mühendisliği Bölümü

  • B‐Spline CurvesExample:

    aksi durumda

    aksi durumda

    aksi durumda

    else

    else

    else

    Dr. Ahmet Zafer Şenalp ME 521 70GYTE-Makine Mühendisliği Bölümü

  • B‐Spline CurvesExample:

    Dr. Ahmet Zafer Şenalp ME 521 71GYTE-Makine Mühendisliği Bölümü

  • B‐Spline CurvesExample:

    Dr. Ahmet Zafer Şenalp ME 521 72GYTE-Makine Mühendisliği Bölümü

  • B‐Spline CurvesExample:

    Replacing into Ni,4* equality;

    By replacing Ni,3 into the above equality the B‐Spline curve equation given below is obtained.

    This equation is the same with Bezier curve with the same control points.Hence cubic B‐Spline curve with 4 control points is the same with cubic Bezier curve with the same control points.

    Dr. Ahmet Zafer Şenalp ME 521 73GYTE-Makine Mühendisliği Bölümü

  • Bezier Blending Functions; Bi,n

    B‐spline Blending Functions; Ni,k

    Bezier /B‐Spline Curves

    Dr. Ahmet Zafer Şenalp ME 521 74GYTE-Makine Mühendisliği Bölümü

  • Bezier /B‐Spline Curves

    Point that is moved

    This point is moving

    This point is not moving

    Dr. Ahmet Zafer Şenalp ME 521 75GYTE-Makine Mühendisliği Bölümü

  • When B‐spline is uniform B‐spline functions with n degrees are just shifted copies of each other.Knots are equally spaced along the curve.

    Uniform B‐Spline Curves

    Dr. Ahmet Zafer Şenalp ME 521 76GYTE-Makine Mühendisliği Bölümü

  • Rational Curves and NURBS

    • Rational polynomials can represent both analytic and polynomial curves in a uniform way

    • Curves can be modified by changing the weighting of the control points

    • A commonly used form is the Non‐Uniform Rational B‐spline (NURBS)

    Dr. Ahmet Zafer Şenalp ME 521 77GYTE-Makine Mühendisliği Bölümü

    http://upload.wikimedia.org/wikipedia/commons/8/81/NURBstatic.svg

  • Rational Bezier Curves

    The rational Bézier adds adjustable weights to provide closer approximations to arbitrary shapes. The numerator is a weighted Bernstein‐form Bézier curve and the denominator is a weighted sum of Bernstein polynomials.

    Given n + 1 control points Pi, the rational Bézier curve can be described by:

    or simply

    Dr. Ahmet Zafer Şenalp ME 521 78GYTE-Makine Mühendisliği Bölümü

    http://en.wikipedia.org/wiki/Bernstein_polynomial

  • Rational B‐Spline Curves

    One rational curve is defined by ratios of 2 polynomials. 

    In rational curve control points are defined in homogenous coordinates.

    Then rational B‐Spline curve can be obtained in the following form:

    Dr. Ahmet Zafer Şenalp ME 521 79GYTE-Makine Mühendisliği Bölümü

  • Rational B‐Spline Curves

    Ri,k(u) is the rational B‐Spline basis functions.

    The above equality show that; Ri,k(u) basis functions are the generelized form of  Ni,k(u).When hi=1 is replaced in Ri,k(u) equality shows the same properties with thenonrational form.

    Dr. Ahmet Zafer Şenalp ME 521 80GYTE-Makine Mühendisliği Bölümü

  • NURBS

    It is non uniform rational B‐Spline formulation. This mathematical model is generally used for constructing curves and surfaces in computer graphics.

    NURBS curve is defined by its degree, control points with weights and knot vector.

    NURBS curves and surfaces are the generalized form of both B‐spline and Bézier  curves and surfaces.

    Most important difference is the weights in the control points which makes NURBS  rational curve.

    NURBS curves have only one parametric direction (generally named as s or u). NURBS surfaces have 2 parametric directions.

    NURBS curves enables the complete modeling of conic curves.

    Dr. Ahmet Zafer Şenalp ME 521 81GYTE-Makine Mühendisliği Bölümü

  • NURBS

    General form of a NURBS curve;

    k: is the number of control points (Pi)wi: weigthsThe denominator is a normalizing factor that evaluates to one if all weights are one. Thiscan be seen from the partition of unity property of the basis functions. It is customary towrite this as

    Rin: are known as the rational basis functions.

    Dr. Ahmet Zafer Şenalp ME 521 82GYTE-Makine Mühendisliği Bölümü

  • NURBSExamples

    Uniform knot vector Nonuniform knot vector

    Dr. Ahmet Zafer Şenalp ME 521 83GYTE-Makine Mühendisliği Bölümü

  • NURBSDevelopment of NURBS

    Boeing: Tiger System in 1979

    SDRC: Geomod in 1993

    University of Utah: Alpha‐1 in 1981

    Industry Standard: IGES, PHIGS, PDES,Pro/E, etc.

    Dr. Ahmet Zafer Şenalp ME 521 84GYTE-Makine Mühendisliği Bölümü

  • NURBSAdvantages

    Serve as a genuine generalizations of non‐rational B‐spline forms as well as rational and non‐rational Bezier curves and surfaces

    Offer a common mathematical form for representing both standard analytic shapes (conics, quadratics, surface of revolution, etc) and free‐from curves and surfaces precisely. B‐splines can only approximate conic curves.

    By evaluating a NURBS curve at various values of the parameter, the curve can be represented in cartesian two‐ or three‐dimensional space. Likewise, by evaluating a NURBS surface at various values of the two parameters, the surface can be represented in cartesian space.

    Provide the flexibility to design a large variety of shapes by using control points and weights. increasing the weights has the effect of drawing a curve toward the control point.

    Dr. Ahmet Zafer Şenalp ME 521 85GYTE-Makine Mühendisliği Bölümü

  • NURBSAdvantages

    Have a powerful tool kit (knot insertion/refinement/removal, degree elevation, splitting, etc.)

    They are invariant under affine as well as perspective transformations: operations like rotations and translations can be applied to NURBS curves and surfaces by applying them to their control points. 

    Reasonably fast and computationally stable. They reduce the memory consumption when storing shapes (compared to simpler methods). 

    They can be evaluated reasonably quickly by numerically stable and accurate algorithms. 

    Clear geometric interpretations

    Dr. Ahmet Zafer Şenalp ME 521 86GYTE-Makine Mühendisliği Bölümü

    5. Curves and Curve Modeling Why Not Simply Use a Point Matrix to�Represent a Curve?Advantages of Analytical�Representation for Geometric EntitiesCurve DefinitionsDrawbacks of �Conventional RepresentationsParametric RepresentationParametric RepresentationParametric RepresentationParametric Explicit Form-�Implicit Form Conversion�Example :Parametric Explicit Form-�Implicit Form Conversion�Example :Curve ClassificationAnalytic CurvesForming Geometry with�Analytic CurvesAnalytic Curves�LineAnalytic Curves�Line�Example:�implicit-explicit form changeAnalytic Curves �CircleAnalytic Curves �EllipseAnalytic Curves �ParabolaAnalytic Curves �HyperbolaSynthetic CurvesSynthetic CurvesSynthetic CurvesComposite Curves�Degrees of ContinuityPosition ContinuitySlope ContinuityCurvature ContinuityComposite Curves�Linear InterpolationParametric Cubic Polynomial CurvesCubic Polynomials�Lagrange Interpolation�Lagrange Interpolation�Lagrange Interpolation �Example:�Lagrange Interpolation �Example:�Cubic Hermite InterpolationCubic Hermite InterpolationCubic Hermite Interpolation�Cubic Hermite Interpolation�Cubic Hermite InterpolationCubic Hermite Interpolation�Approximated CurvesBezier CurvesBezier CurvesBezier CurvesBezier CurvesSlide Number 49Bezier Curves�Linear CurvesBezier Curves�Quadratic CurvesBezier Curves�Higher Order CurvesBezier Curves�Bernstein PolynomialsBezier Curves� Higher Order CurvesBezier Curves �Polinomial FormBezier Curves �Example:Bezier Curves �Example:Bezier Curves �DisadvantagesBezier Curves �Global ChangeBezier Curves �Local ChangeBezier Curves �ExampleBezier Curves �Modeling ExampleB-Spline CurvesB-Spline CurvesB-Spline CurvesB-Spline CurvesB-Spline Curves�PropertiesB-Spline Curves�PropertiesB-Spline Curves �Example:B-Spline Curves �Example:B-Spline Curves �Example:B-Spline Curves �Example:B-Spline Curves �Example:Bezier /B-Spline CurvesBezier /B-Spline CurvesUniform B-Spline CurvesRational Curves and NURBSRational Bezier CurvesRational B-Spline CurvesRational B-Spline CurvesNURBSNURBSNURBS�ExamplesNURBS�Development of NURBS�NURBS�AdvantagesNURBS�Advantages