- 128 Views
- Uploaded on

Download Presentation
## 5. Curves and Curve Modeling

**An Image/Link below is provided (as is) to download presentation**

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript

### 5. Curves and Curve Modeling

ComputerAidedDesign

Dr. Ahmet Zafer Şenalpe-mail: azsenalp@gyte.edu.tr

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

Gebze Yüksek Teknoloji Enstitüsü

5. Curves and Curve Modeling

- 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

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

5. Curves and Curve Modeling

Curves are the basics for surfaces

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

Why Not Simply Use a Point Matrix toRepresent a Curve?

5. Curves and Curve Modeling

- Storage issue and limited resolution
- Computation and transformation
- Difficulties in calculating the intersections or curvesand physical properties of objects
- Difficulties in design (e.g. control shapes of an existing object)
- Poor surface finish of manufactured parts

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

Advantages of AnalyticalRepresentationforGeometricEntities

5. Curves and Curve Modeling

- A few parameters to store
- Designers know the effect of data points on curvebehavior, control, continuity, and curvature
- Facilitate calculations of intersections, object properties, etc.

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

CurveDefinitions

5. Curves and Curve Modeling

- Explicit form:
- Implicit form:

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

Drawbacks of Conventional Representations

5. Curves and Curve Modeling

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

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

Parametric Representation

5. Curves and Curve Modeling

Curves are defined as a function of a single parameter:

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

u

v

Parametric Representation5. Curves and Curve Modeling

Surface, P=P(u,v)

Curve, P=P(u)

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

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

GYTE-MakineMühendisliğiBölümü

Parametric Representation

5. Curves and Curve Modeling

Changingcurveequationintoparametric form:

Let’suse “t” parameter ;

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

ParametricExplicit Form-Implicit Form ConversionExample :

5. Curves and Curve Modeling

Planar 2. degreecurve:

Howtoobtainimplicit form?

t is extracted as:

Replacing t in y equation;

Rearranging the above equation;

Rearranging again;

Weobtain implicit form.

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

ParametricExplicit Form-Implicit Form ConversionExample :

5. Curves and Curve Modeling

Planar 2. degreecurve :

plot

GYTE-MakineMühendisliğiBölümü

Curve Classification

5. Curves and Curve Modeling

CurveClassification:

- AnalyticCurves
- Syntheticcurves

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

AnalyticCurves

5. Curves and Curve Modeling

Thesecurveshave an analyticequation

- point
- line
- arc
- circle
- fillet
- Chamfer
- Conics(ellipse, parabola,andhyperbola))

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

FormingGeometrywithAnalyticCurves

5. Curves and Curve Modeling

line

arc

circle

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

AnalyticCurvesLine

5. Curves and Curve Modeling

Line definition in cartesian coordinate system:

- Here;
- m:slope of theline
- b:pointthatintersects y axis
- x:independentvaraible of y function.

Parametric form;

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

AnalyticCurvesLineExample:implicit-explicit form change

5. Curves and Curve Modeling

Line equation:

implicit form

explicit form

Changingtoparametric form. Inthiscase

Let . Replacingthisvalueto y equation.

İs obtained.

As a result;

Parametriclineequation is obtained.

Toturnbacktoimplicitorexplicitnonparametric form t is repaced in x and y equalities

Fromherethe form at thebeginning is obtained.

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

AnalyticCurvesCircle

5. Curves and Curve Modeling

Circle definition in Cartesian coordinate system:

- Here;
- a,b:x,y coordinates of centerpoint
- r: circleradius
- Parametric form

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

AnalyticCurvesEllipse

5. Curves and Curve Modeling

Ellipse definition in Cartesian coordinate system:

- Here;
- h,k:x,y coordinates of centerpoint
- a: radius of majoraxis
- b: radius of minör exis
- Parametric form

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

AnalyticCurvesParabola

5. Curves and Curve Modeling

Parabola definition in Cartesian coordinate system:

- Usual form;

y = ax2 + bx + c

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

AnalyticCurvesHyperbola

5. Curves and Curve Modeling

Hyperbola definition in Cartesian coordinate system:

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

Synthetic Curves

5. Curves and Curve Modeling

As the name impliestheseareartificialcurves

- Lagrangeinterpolationcurves
- Hermiteinterpolationcurves
- Bezier
- B-Spline
- NURBS
- etc.
- Analytic curves are usually not sufficient to meet geometricdesign requirements of mechanical parts.
- Many products need free-form, or synthetic curvedsurfaces
- Thesecurvesuse a series of controlpointseitherinterploatedoraproximated
- It is thedefinitionmethosforcomplexcurves.
- Itshould be controllablebythedesigner.
- Calculationandstorageshould be easy.
- At thesame time called as free form curves.

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

approximated

Synthetic Curves5. Curves and Curve Modeling

controlpoints

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

1

3

4

Composite Curves5. Curves and Curve Modeling

- Curves can be represented by connected segments to form a composite curve
- There must be continuity at the mid-points

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

Degrees of Continuity

5. Curves and Curve Modeling

- Position continuity
- Slope continuity

1st derivative

- Curvature continuity

2nd derivative

- Higher derivatives as necessary

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

PositionContinuity

5. Curves and Curve Modeling

Mid-pointsareconnected

2

1

3

Connected (C0 continuity)

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

SlopeContinuity

5. Curves and Curve Modeling

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

1

2

Continuous tangent

Tangent continuity (C1 continuity)

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

Curvature Continuity

5. Curves and Curve Modeling

Bothcurveshavethesame 2.derivativevalue at theconnectionpoint.

At the same time position andslopecontinuity is also attained.

1

2

Continuous curvature

Curvature continuity (C2 continuity)

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

1

3

4

Cubic polynomials

5. Curves and Curve Modeling

Composite Curves- A cubic spline has C2 continuity at intermediate points
- Cubic splines do not allow local control

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

LinearInterpolation

5. Curves and Curve Modeling

General Linear Interpolation:

One of the simplest method is linear interpolation.

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

Parametric Cubic Polynomial Curves

5. Curves and Curve Modeling

- Cubic polynomials are the lowest-order polynomials that can represent a non-planar curve
- The curve can be defined by 4 boundary conditions

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

p1

p3

P0’

p1

p2

p0

Hermite

Lagrange

p0

Cubic Polynomials5. Curves and Curve Modeling

- Lagrange interpolation - 4 points
- Hermite interpolation - 2 points, 2 slopes

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

LagrangeInterpolation

5. Curves and Curve Modeling

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:

Belowpolynomial is calledLagrangebasepolynomial;

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

LagrangeInterpolation

5. Curves and Curve Modeling

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

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

LagrangeInterpolationExample:

5. Curves and Curve Modeling

A 3. degree L(x) function has thefollowing x andcorresponding y values;

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

l1(x)=

l2(x)=

l3(x)=

l4(x)=

l5(x)=

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

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

LagrangeInterpolationExample:

5. Curves and Curve Modeling

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

obtained.

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

CubicHermiteInterpolation

5. Curves and Curve Modeling

Alsoknown as cubicsplines.

Enablesupto C1continuity.

There are no algebraic coefficints but there are geometric coefficints

General form of CubicHermiteinterpolation:

Position vector at the starting point

Position vector at the end point

Tangent vector at the starting point

Tangent vector at the endpoint

GYTE-MakineMühendisliğiBölümü

CubicHermiteInterpolation

Hermite base functions

Hermite form is obtainedbythelinearsummation of this 4 function at eachinterval.

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

CubicHermiteInterpolation

The effect of tangent vector to the curve shape

Geometrik katsayı

matrisi

Geometriccoefficientmatrixcontrolstheshape of thecurve.

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

CubicHermiteInterpolation

Hermitecurve set withsameendpoints (P0 ve P1),

Tangentvectors P0’ and P1’havethesamedirections but

P0’ havedifferentmagnitude P1’ is constant

P0’

P2

P0

T2

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

CubicHermiteInterpolation

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

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

CubicHermiteInterpolation

5. Curves and Curve Modeling

CubicHermiteinterpolation form:

There are no algebraic coefficints but there are geometric coefficints

Can also be written as:

GYTE-MakineMühendisliğiBö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.

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

Bezier Curves

General Beziercurve form which is controlledby n+1 Picontrolpoints;

wherethepolynomials

are known as Bernstein basis polynomials of degree n,

defining t0 = 1 and (1 - t)0 = 1.

: binomial coefficient.

Degree of polynomial is onelessthanthecontrolpointsused.

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

- 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.

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

Bezier CurvesLinearCurves

t= [0,1] form of a linearBéziercurveturnsoutto be linearinterpolloation form.

Curvepassesthroughpoints P0ve P1.

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

For example when t=0.25, B(t) is one quarter of theway from point P0 to P1. As t varies from 0 to 1, B(t) describes acurved line from P0 to P1.

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

Bezier CurvesQuadraticCurves

Curvepassesthrough P0 ,P1& P2 points.

- 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.

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

Bezier CurvesHigherOrderCurves

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

CubicBezierCurve

Curvepassesthrough 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

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

1

BB1

BB4

BB2

BB3

t

1

5. Curves and Curve Modeling

Bezier CurvesBernstein PolynomialsMost of thegraphicspackagesconfineBéziercurvewithonly 4 controlpoints. Hencen = 3 .

Bernstein polinomials

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

Bezier CurvesHigherOrderCurves

FourthOrderBezierCurve

Curvepassesthrough 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ézier curves, and points S0 & S1 that describe cubic Bézier curves:

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

Bezier CurvesPolinomial Form

- Sometimes it is desirable to express the Bézier curve as a polynomialinstead 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).

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

Bezier CurvesExample:

Coordinatess of 4 control poits are given as:

- What is theequation of Beziercurvethatwill be obtainedbyusingabovepoints?
- Whatarethecoordinatevalues on thecurvecorrespondingto t=0,1/4,2/4,3/4,1 ?
- Solution:
- For 4 points 3. orderBezier form is used:

: Beziercurveequation

Points on B(t)curve

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

Bezier CurvesExample:

Equation of Bezier curve:

Controlpoints

Points on B(t) curve

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

Bezier CurvesDisadvantages

- Difficult to interpolate points
- Cannot locally modify a Bezier curve

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

Bezier CurvesExample

2 cubiccompositeBéziercurve- 6. orderBéziercurve

comparisson

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

B-SplineCurves

- 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 supportwith 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.

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

B-SplineCurves

Pidefines B-Splinecurvewithgiven n+1 controlpoints:

HereNi,k(u) is B-SplinefunctionsproposedbyCox ve de Boor tarafından in 1972.

k parametercontrols B-Splinecurvedegree (k-1) andgenerallyindependent of number of controlpoints.

aksi durumda

uiis calledparametricknotsor (knotvales) for an opencurve B-Spline:

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

B-SplineCurves

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

- Thisineequalityshowsthat;
- forlinearcurve at least 2
- for 2. degreecurve at least 3
- forcubiccurve at least 4 controlpointsarenecessary.

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

B-SplineCurves

Belowfiguresshow B-Splinefunctions:

Linearfunction

k=2

2. degreefunction

k=3

cubicfunction

k=4

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

B-SplineCurvesProperties

Number of controlpoints is independentthanthedegree of thepolynomial.

Quadratic B-Spline; k=3

vertex

Linear

k=2

Cubic B-Spline; k=4

FourthOrder B-Spline; k=5

vertex

The higher the order ofthe B-Spline, the less theinfluencetheclose

controlpoint

vertex

n=3

vertex

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

B-SplineCurvesProperties

B-spline allows better local control. Shape of the curve

can be adjusted by moving the control points.

Local control: a control point only influences k segments.

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

B-SplineCurvesExample:

CubicSpline; k=4, n=3

8 knotsarerequired.

reminder: To define a (k-1) degreecurve with (n+1) control points (n+k+1) knots are required.

Equationresults 8 knots

reminder:

Limits of u parameter:

Beziercurveequality;

*

B-Splinevector can be calculatedtogetherwithknotvector;

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

B-SplineCurvesExample:

aksi durumda

else

else

aksi durumda

aksi durumda

else

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

B-SplineCurvesExample:

ReplacingintoNi,4* equality;

By replacing Ni,3into 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.

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

Bezier/B-SplineCurves

BezierBlendingFunctions; Bi,n

B-splineBlendingFunctions; Ni,k

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

Bezier/B-SplineCurves

Thispoint is moving

Pointthat is moved

Thispoint is not moving

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

UniformB-SplineCurves

WhenB-spline is uniformB-splinefunctionswith n degreesarejustshiftedcopies of eachother.

Knotsareequallyspacedalongthecurve.

GYTE-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)

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

Rational Bezier Curves

The rational Bézier adds adjustable weights to provide closerapproximations 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:

orsimply

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

Rational B-SplineCurves

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:

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

Rational B-SplineCurves

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

Theaboveequalityshowthat;Ri,k(u) basisfunctionsarethegenerelized form of Ni,k(u).

Whenhi=1 is replaced in Ri,k(u) equalityshowsthesamepropertieswiththe

nonrational form.

GYTE-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.

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

NURBS

General form of a NURBS curve;

k: is the number of control points (Pi)

wi: weigths

The denominator is a normalizing factor that evaluates to one if all weights are one. This can be seen from the partition of unity property of the basis functions. It is customary to write this as

Rin: are known as the rational basis functions.

GYTE-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.

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

NURBSAdvantages

- Serve as a genuine generalizations of non-rational B-spline formsas well as rational and non-rational Bezier curves and surfaces
- Offer a common mathematical form for representing both standardanalytic shapes (conics, quadratics, surface of revolution, etc) andfree-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 usingcontrol points and weights. increasing the weights has the effect ofdrawing a curve toward the control point.

GYTE-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

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

Download Presentation

Connecting to Server..