Presentation is loading. Please wait.

Presentation is loading. Please wait.

7. Curves and Curve Modeling Assoc.Prof.Dr. Ahmet Zafer Şenalp Mechanical Engineering Department Gebze.

Similar presentations


Presentation on theme: "7. Curves and Curve Modeling Assoc.Prof.Dr. Ahmet Zafer Şenalp Mechanical Engineering Department Gebze."— Presentation transcript:

1 7. Curves and Curve Modeling e-mail: Assoc.Prof.Dr. Ahmet Zafer Şenalp e-mail: azsenalp@gmail.comazsenalp@gmail.com Mechanical Engineering Department Gebze Technical University ME 521 Computer Aided Design

2  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 2 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

3 Curves are the basics for surfaces Dr. Ahmet Zafer Şenalp ME 521 3 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

4 Why Not Simply Use a Point Matrix to Represent 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 4 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

5 Advantages of Analytical Representation 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 5 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

6 Curve Definitions  Explicit form :  Implicit form : Dr. Ahmet Zafer Şenalp ME 521 6 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

7 Explicit Representation The explicit form of a curve in two dimensions gives the value of one variable, the dependent variable, in terms of the other, the independent variable. In x,y space, we might write y=f(x). A surface represented by an equation of the form z=f(x,y) Dr. Ahmet Zafer Şenalp ME 521 7 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

8 Implicit Representations In two dimensions,an implicit curve can be represented by the equation f(x,y)=0 The implicit form is less coordinate system dependent than is the explicit form. In three dimensions, the implicit form f(x,y,z)=0 Curves in three dimensions are not as easily represented in implicit form. We can represent a curve as the intersection, if it exists, of the two surfaces: f(x,y,z)=0, g(x,y,z)=0. Dr. Ahmet Zafer Şenalp ME 521 8 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

9 Drawbacks of Conventional Representations Conventional explicit and implicit forms have several drawbacks.  They 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 9 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

10 Parametric Representation Curves can be defined as a function of a single parameter. The parametric form of a curve expresses the value of each spatial variable for points on the curve in terms of an independent variable,u, the parameter. In three dimensions, we have three explicit functions: Dr. Ahmet Zafer Şenalp ME 521 10 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

11 Curve, P=P(u) P(u)=[x(u),y(u),z(u)] T Parametric Representation Dr. Ahmet Zafer Şenalp ME 521 11 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

12 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 Şenalp ME 521 12 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

13 Parametric Representation Dr. Ahmet Zafer Şenalp ME 521 13 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling DESIGN CRITERIA There are many considerations that determine why we prefer to use parametric polynomials of low degree, including: Local control of shape Smoothness and continuity Ability to evaluate derivatives Stability Ease of rendering

14 Parametric Representation Changing curve equation into parametric form: Let’s use “t” parameter ; Dr. Ahmet Zafer Şenalp ME 521 14 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

15 Parametric Explicit Form- Implicit Form Conversion Example : 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. Dr. Ahmet Zafer Şenalp ME 521 15 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

16 Parametric Explicit Form- Implicit Form Conversion Example : Planar 2. degree curve : plot Dr. Ahmet Zafer Şenalp ME 521 16 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

17 Curve Classification Curve Classification:  Analytic Curves  Synthetic curves Dr. Ahmet Zafer Şenalp ME 521 17 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

18 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 18 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

19 line arc circle Forming Geometry with Analytic Curves Dr. Ahmet Zafer Şenalp ME 521 19 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

20 Analytic Curves Line Line definition in cartesian coordinate system: Here; m: slope of the line b: point that intersects y axis x: independent varaible of y function. Parametric form; Dr. Ahmet Zafer Şenalp ME 521 20 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

21 Analytic Curves Line Example: implicit-explicit form change Line equation: Parametric line equation is obtained. To turn back to implicit or explicit nonparametric form t is replaced in x and y equalities implicit form explicit form Changing to parametric form. In this case Let. Replacing this value into y equation. is obtained. As a result; From here the form at the beginning is obtained. Dr. Ahmet Zafer Şenalp ME 521 21 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

22 Analytic Curves Circle Circle definition in Cartesian coordinate system: Here; a,b: x,y coordinates of center point r: circle radius Parametric form Dr. Ahmet Zafer Şenalp ME 521 22 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

23 Analytic Curves Ellipse Ellipse definition in Cartesian coordinate system: Here; h,k: x,y coordinates of center point a: radius of major axis b: radius of minör exis Parametric form Dr. Ahmet Zafer Şenalp ME 521 23 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

24 Analytic Curves Parabola Parabola definition in Cartesian coordinate system: Usual form; y = ax 2 + bx + c Dr. Ahmet Zafer Şenalp ME 521 24 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

25 Analytic Curves Hyperbola Hyperbola definition in Cartesian coordinate system: Dr. Ahmet Zafer Şenalp ME 521 25 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

26 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 method 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 26 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

27 Synthetic Curves open curve closed curve Dr. Ahmet Zafer Şenalp ME 521 27 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

28 interpolatedapproximated control points Synthetic Curves Dr. Ahmet Zafer Şenalp ME 521 28 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

29 Degrees of Continuity  Position continuity  Slope continuity 1 st derivative  Curvature continuity 2 nd derivative Higher derivatives as necessary Dr. Ahmet Zafer Şenalp ME 521 29 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

30 Position Continuity 1 2 3 Connected (C 0 continuity) Mid-points are connected Dr. Ahmet Zafer Şenalp ME 521 30 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

31 Slope Continuity 1 2 Continuous tangent Tangent continuity (C 1 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 31 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

32 Continuous curvature Curvature continuity (C 2 continuity) 1 2 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 32 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

33 Composite Curves  Curves can be represented by connected segments to form a composite curve  There must be continuity at the mid-points 1 2 3 4 Dr. Ahmet Zafer Şenalp ME 521 33 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

34 Composite Curves  A cubic spline has C 2 continuity at intermediate points  Cubic splines do not allow local control 1 2 3 4 Cubic polynomials Dr. Ahmet Zafer Şenalp ME 521 34 Mechanical Engineering Department, GTU

35 Linear Interpolation General Linear Interpolation: One of the simplest method is linear interpolation. Dr. Ahmet Zafer Şenalp ME 521 35 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

36 Parametric Cubic Polynomial Curves  Once we have decided to use parametric polynomial curves, we must choose the degree of the curve.  If we choose a high degree, we will have many parameters that we can set to form the desired shape, but evaluation of points on the curve will be costly.  In addition, as the degree of a polynomial curve becomes higher, there is more danger that the curve will become rougher.  On the other hand, if we pick too low a degree, we may not have enough parameters with which to work. Dr. Ahmet Zafer Şenalp ME 521 36 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

37 Parametric Cubic Polynomial Curves  However, if we design each curve segment over a short interval, we can achieve many of our purposes with low-degree curves.  Although there may be only a few degrees of freedom these few may be sufficient to allow us to produce the desired shape in a small region. For this reason, most designers, at least initially, work with cubic polynomial curves. Dr. Ahmet Zafer Şenalp ME 521 37 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

38 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 Dr. Ahmet Zafer Şenalp ME 521 38 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

39 Cubic Polynomials  Lagrange interpolation - 4 points  Hermite interpolation - 2 points, 2 slopes p0p0 p3p3 p2p2 p1p1 Lagrange p0p0 p1p1 P1’P1’ P0’P0’ Hermite Dr. Ahmet Zafer Şenalp ME 521 39 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

40 Lagrange Interpolation Lagrange interpolation form is not only in cubic form that requires 4 points but there are several forms: Dr. Ahmet Zafer Şenalp ME 521 40 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling 1 st order : 2 points 2 nd order: 3 points 3 rd order: 4 points 4 th order: 5 points

41 Lagrange Interpolation 2 x i terms should not be the same, For N+1 data points ; (x 0,y 0 ),...,(x N,y N ) için Lagrange interpolation form is in the form of linear combination: Below polynomial is called Lagrange base polynomial; Dr. Ahmet Zafer Şenalp ME 521 41 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

42 Lagrange Interpolation Example: 2 nd order Lagrange polynomial example with 3 points Dr. Ahmet Zafer Şenalp ME 521 42 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

43 Dr. Ahmet Zafer Şenalp ME 521 43 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling 2 nd order Lagrange polynomial example with 3 points In fact in order to model a 3 rd degree curve we should have to use 4 points. Lagrange Interpolation Example:

44 Dr. Ahmet Zafer Şenalp ME 521 44 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling 3 rd order Lagrange polynomial example with 4 points. Here is a set of data points: Here is a plot of 4 points. Lagrange Interpolation Example:

45 Dr. Ahmet Zafer Şenalp ME 521 45 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

46 Lagrange Interpolation Example: Dr. Ahmet Zafer Şenalp ME 521 46 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling 3 rd order Lagrange polynomial example with 4 points. Here is a set of data points:

47 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 y 0 ℓ 0 (x), y 1 ℓ 1 (x), y 2 ℓ 2 (x) and y 3 ℓ 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 47 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

48 Lagrange Interpolation Example: A 3. degree L(x) function has the following x and corresponding y values; The polynomial corresponding to the above values can be determined by Lagrange interpolation method: Dr. Ahmet Zafer Şenalp ME 521 48 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

49 Lagrange Interpolation Example: obtained. L(x)= -0,7083x 4 +7,4167x 3 -22,2917x 2 +13,5833x+8 Dr. Ahmet Zafer Şenalp ME 521 49 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

50 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 end point General form of Cubic Hermite interpolation: Also known as cubic splines. Enables up to C 1 continuity. Dr. Ahmet Zafer Şenalp ME 521 50 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling

51 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 51 Mechanical Engineering Department, GTU

52 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 52 Mechanical Engineering Department, GTU

53 Cubic Hermite Interpolation Hermite curve set with same end points (P 0 ve P 1 ), Tangent vectors P 0 ’ and P 1 ’ have the same directions but P 0 ’ have different magnitude P 1 ’ is constant P0P0 P0’P0’ P2P2 T2T2 Dr. Ahmet Zafer Şenalp ME 521 53 Mechanical Engineering Department, GTU

54 Cubic Hermite Interpolation All tangent vector magnitudes are equal but the direction of left tangent vector changes. Dr. Ahmet Zafer Şenalp ME 521 54 Mechanical Engineering Department, GTU

55 Cubic Hermite Interpolation There are no algebraic coefficints but there are geometric coefficints Cubic Hermite interpolation form: Dr. Ahmet Zafer Şenalp ME 521 55 Mechanical Engineering Department, GTU 7. Curves and Curve Modeling Can also be written as:

56 Approximated Curves  Bezier  B-Spline  NURBS  etc. Dr. Ahmet Zafer Şenalp ME 521 56 Mechanical Engineering Department, GTU

57 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 C 1 continuity. Dr. Ahmet Zafer Şenalp ME 521 57 Mechanical Engineering Department, GTU

58 Control polygon Bezier Curves Dr. Ahmet Zafer Şenalp ME 521 58 Mechanical Engineering Department, GTU

59 Bezier Curves Dr. Ahmet Zafer Şenalp ME 521 59 Mechanical Engineering Department, GTU

60 Bezier Curves where the polynomials are known as Bernstein basis polynomials of degree n,Bernstein basis polynomials defining t 0 = 1 and (1 - t) 0 = 1. General Bezier curve form which is controlled by n+1 P i control points; : binomial coefficient.binomial coefficient Degree of polynomial is one less than the control points used. Dr. Ahmet Zafer Şenalp ME 521 60 Mechanical Engineering Department, GTU

61  The points P i are called control points for the Bézier curve  The polygon formed by connecting the Bézier points with lines, starting with P 0 and finishing with P n, is called the Bézier polygon (or control polygon). The convex hull of the Bézier polygon contains the Bézier curve.polygonlinesconvex hull  The curve begins at P 0 and ends at P n ; this is the so-called endpoint interpolation property.  The curve is a straight line if and only if all the control points are collinear.collinear  The start (end) of the curve is tangent to the first (last) section of the Bézier polygon.tangent  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 61 Mechanical Engineering Department, GTU

62 Bezier Curves Linear Curves t= [0,1] form of a linear Bézier curve turns out to be linear interpollation form. Curve passes through points P 0 ve P 1. Animation of a linear Bézier curve, t in [0,1]. The t in the function for a linear Bézier curve can be thought of as describing how far B(t) is from P 0 to P 1. For example when t=0.25, B(t) is one quarter of the way from point P 0 to P 1. As t varies from 0 to 1, B(t) describes a curved line from P 0 to P 1. Dr. Ahmet Zafer Şenalp ME 521 62 Mechanical Engineering Department, GTU

63 Bezier Curves Quadratic Curves  For quadratic Bézier curves one can construct intermediate points Q 0 and Q 1 such that as t varies from 0 to 1:  Point Q 0 varies from P 0 to P 1 and describes a linear Bézier curve.   Point Q 1 varies from P 1 to P 2 and describes a linear Bézier curve.  Point B(t) varies from Q 0 to Q 1 and describes a quadratic Bézier curve. Curve passes through P 0, P 1 & P 2 points. Dr. Ahmet Zafer Şenalp ME 521 63 Mechanical Engineering Department, GTU

64 Bezier Curves Higher Order Curves For higher-order curves one needs correspondingly more intermediate points. Cubic Bezier Curve Curve passes through P 0, P 1, P 2 & P 3 points. For cubic curves one can construct intermediate points Q 0, Q 1 & Q 2 that describe linear Bézier curves, and points R 0 & R 1 that describe quadratic Bézier curves Dr. Ahmet Zafer Şenalp ME 521 64 Mechanical Engineering Department, GTU

65 Bezier Curves Bernstein Polynomials Most of the graphics packages confine Bézier curve with only 4 control points. Hence n = 3. Bernstein polinomials t f(t) 1 1 B B1 B B4 B B2 B B3 Dr. Ahmet Zafer Şenalp ME 521 65 Mechanical Engineering Department, GTU

66 Bezier Curves Higher Order Curves Fourth Order Bezier Curve Curve passes through P 0, P 1, P 2, P 3 & P 4 points. For fourth-order curves one can construct intermediate points Q 0, Q 1, Q 2 & Q 3 that describe linear Bézier curves, points R 0, R 1 & R 2 that describe quadratic Bézier curves, and points S 0 & S 1 that describe cubic Bézier curves: Dr. Ahmet Zafer Şenalp ME 521 66 Mechanical Engineering Department, GTU

67 Bezier Curves Polinomial Form  Sometimes it is desirable to express the Bézier curve as a polynomial instead of a sum of less straightforward Bernstein polynomials.polynomialBernstein polynomials  Application of the binomial theorem to the definition of the curve followed by some rearrangement will yield:binomial theorem and This could be practical if C j 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).numeric stabilityde Casteljau's algorithm Dr. Ahmet Zafer Şenalp ME 521 67 Mechanical Engineering Department, GTU

68 Bezier Curves Example: 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: Points on B(t) curve : Bezier curve equation Dr. Ahmet Zafer Şenalp ME 521 68 Mechanical Engineering Department, GTU

69 Bezier Curves Example: Equation of Bezier curve: Control points Points on B(t) curve Dr. Ahmet Zafer Şenalp ME 521 69 Mechanical Engineering Department, GTU

70 Bezier Curves Disadvantages  Difficult to interpolate points  Cannot locally modify a Bezier curve Dr. Ahmet Zafer Şenalp ME 521 70 Mechanical Engineering Department, GTU

71 Bezier Curves Global Change Dr. Ahmet Zafer Şenalp ME 521 71 Mechanical Engineering Department, GTU

72 Bezier Curves Local Change Dr. Ahmet Zafer Şenalp ME 521 72 Mechanical Engineering Department, GTU

73 Bezier Curves Example 2 cubic composite Bézier curve - 6. order Bézier curve comparisson Dr. Ahmet Zafer Şenalp ME 521 73 Mechanical Engineering Department, GTU

74 Bezier Curves Modeling Example Contains 32 curve Polygon representation Dr. Ahmet Zafer Şenalp ME 521 74 Mechanical Engineering Department, GTU

75 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.degree smoothnessdomain  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.linear combination  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.numerically stablede 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.Bézier curveRunge phenomenon  The degree of curve obtained is independent of number of control points.  Enables up to C 2 continuity. Dr. Ahmet Zafer Şenalp ME 521 75 Mechanical Engineering Department, GTU

76 B-Spline Curves P i defines B-Spline curve with given n+1 control points: Here N i,k (u) is B-Spline functions are proposed by Cox and de Boor in 1972. k parameter controls B-Spline curve degree (k-1) and generally independent of number of control points. u i is called parametric knots or (knot vales) for an open curve B-Spline: aksi durumda Dr. Ahmet Zafer Şenalp ME 521 76 Mechanical Engineering Department, GTU

77 This inequality shows that;  for linear curve at least 2  for 2. degree curve at least 3  for 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 then are required. Dr. Ahmet Zafer Şenalp ME 521 77 Mechanical Engineering Department, GTU

78 Linear function k=2 B-Spline Curves Below figures show B-Spline functions: 2. degree function k=3 cubic function k=4 Dr. Ahmet Zafer Şenalp ME 521 78 Mechanical Engineering Department, GTU

79 Number of control points is independent than the degree of the polynomial. B-Spline Curves Properties The higher the order of the B-Spline, the less the influence the close control point Linear k=2 vertex Quadratic B-Spline; k=3 Cubic B-Spline; k=4 Fourth Order B-Spline; k=5 n=3 vertex Dr. Ahmet Zafer Şenalp ME 521 79 Mechanical Engineering Department, GTU

80 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. B-Spline Curves Properties Dr. Ahmet Zafer Şenalp ME 521 80 Mechanical Engineering Department, GTU

81 B-Spline Curves Example: Cubic Spline; k=4, n=3 8 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 81 Mechanical Engineering Department, GTU

82 B-Spline Curves Example: aksi durumda else Dr. Ahmet Zafer Şenalp ME 521 82 Mechanical Engineering Department, GTU

83 B-Spline Curves Example: Dr. Ahmet Zafer Şenalp ME 521 83 Mechanical Engineering Department, GTU

84 B-Spline Curves Example: Dr. Ahmet Zafer Şenalp ME 521 84 Mechanical Engineering Department, GTU

85 B-Spline Curves Example: Replacing into N i,4 * equality; By replacing N i,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 85 Mechanical Engineering Department, GTU

86 Bezier Blending Functions; B i,n B-spline Blending Functions; N i,k Bezier /B-Spline Curves Dr. Ahmet Zafer Şenalp ME 521 86 Mechanical Engineering Department, GTU

87 Bezier /B-Spline Curves Point that is moved This point is moving This point is not moving Dr. Ahmet Zafer Şenalp ME 521 87 Mechanical Engineering Department, GTU

88 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 88 Mechanical Engineering Department, GTU

89 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 89 Mechanical Engineering Department, GTU

90 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.Bernstein polynomials Given n + 1 control points P i, the rational Bézier curve can be described by: or simply Dr. Ahmet Zafer Şenalp ME 521 90 Mechanical Engineering Department, GTU

91 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 91 Mechanical Engineering Department, GTU

92 Rational B-Spline Curves R i,k (u) is the rational B-Spline basis functions. The above equality show that; R i,k (u) basis functions are the generelized form of N i,k (u). When h i =1 is replaced in R i,k (u) equality shows the same properties with the nonrational form. Dr. Ahmet Zafer Şenalp ME 521 92 Mechanical Engineering Department, GTU

93 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 93 Mechanical Engineering Department, GTU

94 NURBS General form of a NURBS curve; k: is the number of control points (P i ) w i : 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 R in : are known as the rational basis functions. Dr. Ahmet Zafer Şenalp ME 521 94 Mechanical Engineering Department, GTU

95 NURBS Examples Uniform knot vectorNonuniform knot vector Dr. Ahmet Zafer Şenalp ME 521 95 Mechanical Engineering Department, GTU

96 NURBS Development 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 96 Mechanical Engineering Department, GTU

97 NURBS Advantages 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 97 Mechanical Engineering Department, GTU

98 NURBS Advantages 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 98 Mechanical Engineering Department, GTU


Download ppt "7. Curves and Curve Modeling Assoc.Prof.Dr. Ahmet Zafer Şenalp Mechanical Engineering Department Gebze."

Similar presentations


Ads by Google