Presentation is loading. Please wait.

Presentation is loading. Please wait.

Curves: ch 4 of McConnell General problem with constructing curves: how to create curves that are “smooth” CAD problem Curves could be composed of segments.

Similar presentations


Presentation on theme: "Curves: ch 4 of McConnell General problem with constructing curves: how to create curves that are “smooth” CAD problem Curves could be composed of segments."— Presentation transcript:

1 Curves: ch 4 of McConnell General problem with constructing curves: how to create curves that are “smooth” CAD problem Curves could be composed of segments that are joined together- called continuity- segments are determined by points If segments are lines then called piecewise linear Segments are generally written as functions of the parameter t; curves are traced out on [0,1]

2 Parametric Line Segments Recall that line segments can be written in parametric form For example, the line segment from P 0 to P 1 is L(t)=(1 – t) P 0 + tP 1 where If t=0 you have the point P 0 and if t=1 you have the point P 1 This results in two (or three) equations: one for x and one for y Example

3 Line segments could be joined end to end. This is called piecewise linear: The problem is that at the vertices it is continuous but it is not smooth

4 Curves: Bezier (Cubic) Bezier curves composed of (cubic) polynomials- Bezier was a designer for Renault Gives curves instead of lines Cubic Bezier curve is determined by four points: goes through the first and last (interpolates these two), not necessarily through the middle two; the first and second determine the slope of the tangent line at P 0 ; third and fourth determine the tangent line at P 3 Two Beziers can be joined by adding three more points: P 3 becomes the first in the next group; assures continuity Can also have higher dimensions

5 Curves: Bezier (con’t) Matrix equations for cubic Bezier curves:

6 Example of Bezier Curve Write down the equation(s) for the Bezier curve going through P 0 (10,80) P 1 (30,50) P 2 (60,30) P 3 (70,90) Draw the points. Use the equation with t=0, t=1 and several more values of t (for example, t=1/2, t=3/4)

7 Bezier curve www.siggraph.org/education/materials/HyperGraph/modeling/splines/spli nes0.htm

8 Properties of Bezier Curves Goes through endpoints Invariant under affine transformations (includes trans, rot, scaling) Curve lies within the convex hull If control points on a straight line then the curve is a straight line Tangents at end points dependent on proximate points (p 1 determines tangent at p 0, and p 2 determines tangent at p 3 )

9 Derivatives of Bezier Curves Use the equations to show that f’(0)=3(p 1 -p 0 ) and f’(1)=3(p 3 -p 2 )

10 Chaining together Beziers Are guaranteed to have continuity because Bezier interpolates the first and last control point If chaining together and the second point of the second curve is colinear with the last two points on the first curve have G 1 continuity (derivatives are in the same direction- pretty smooth)- if they are colinear and equidistant from the joint then have C 1 continuity (derivatives are the same)

11 Subdividing a Bezier Method to guarantee that the subdivision produces two Beziers (De Casteljau algorithm)- not just in half but at any point The two Beziers trace out the same curve as the original Bezier Good for divide-and-conquer algorithms, intersections, linearity checks, rendering Processing has functions for constructing third degree Bezier curves.

12 Cubic B-splines One problem with Bezier curves is that they aren’t “smooth” where they join – the derivatives aren’t the same Cubic B-splines are also composed of cubic polynomials but exhibit C 2 continuity: continuous, first and second derivatives all coincide In general, B-splines are constructed from polynomials of degree k; have k-1 continuity

13 Cubic B-splines (con’t) Each segment is a cubic polynomial f i [0,1] that represents a curve for the points p i and p i+1 but is determined by four points: p i-1 p i p i+1 and p i+2 f i (0) depends on the first three points and f i (1) depends on the last three The next cubic polynomial is determined from p i p i+1 p i+2 and p i+3 The segments don’t necessarily interpolate (go through) the points

14 Cubic B-splines (con’t) The matrix equations are

15 Cubic B-splines (con’t) B-splines can be subdivided also Can be of higher order Processing’s curve() function uses a spline implementation of the Catmull-Rom algorithm.

16 Other Curves NURBS: Non-uniform Rational B-Splines Rational means can have ratios of polynomials Curve sections may not have t always ranging from [0,1]

17 Surfaces Bezier patches or surfaces: 16 control points p ij in a grid with 4 control points on each side: interpolates the 4 corner points Bezier patches can be chained together also B-spline surfaces Can also use curves to sweep out 3D objects: in a circle, line, etc.


Download ppt "Curves: ch 4 of McConnell General problem with constructing curves: how to create curves that are “smooth” CAD problem Curves could be composed of segments."

Similar presentations


Ads by Google