1 / 25

Bezier Curves

Bezier Curves. Part II. Assume we are given two endpoints labelled E1 and E2 and two control points labelled C1 and C2. create a smooth curve whose endpoints will be E1 and E2 . The curve should have

kirima
Download Presentation

Bezier Curves

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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Bezier Curves Part II

  2. Assume we are given two endpoints labelled E1 and E2 and two control points labelled C1 and C2. create a smooth curve whose endpoints will be E1and E2. The curve should have the additional property that the slope of the tangent line leaving E1 should be the same as the slope of the line connecting points E1and C1.

  3. In fact, the reason point C1 is called a control point is that the position of C1relative to E1 determines the slope of the curve as it leaves point E1 and starts bending towards point E2. In general, the curve need not go through or even be near either C1or C2. Similarly, we want our curve to finish by going through the endpoint E2, but as it does so, we want the shape of the curve to match the direction of the line segment connecting C2 to E2. Thus C2 acts as a control point, but its control over the shape of the curve is influenced primarily by C2 's position relative to the point E2. The control points C1 and C2 are independent of one another. It is only the relative positions of C1 and E1 and then that of C2 and E2 that will help determine the shape of the curve we would like to draw.

  4. Homework Write a Matlab code to create a smooth curve whose endpoints will be E1and E2. With the control points C1 and C2 variable!

  5. We can imagine there could be many such ways to generate a curve like that shown earlier. In fact, we could simply draw the curve by using a freehand sketch, but there must be a simple way to do it using mathematics. Cubic polynomials turn out to fill the bill quite nicely; these polynomials are neither too simple to accomplish the task at hand, nor are they too complex to actually work with. A first attempt might be to try quadratic (2nd degree) polynomials, but these have only one non-constant derivative and we are trying to make use of two independent tangents at the curve endpoints. After some reflection we might think we could gain even more control by using 4th or 5th or even 6th degree polynomials, but while this is true, the resulting formulas become more complex and on a computer they take up more memory and more execution time. Cubic polynomials turn out to be sufficiently rich but not overly burdensome.

  6. Given two endpoints E1(x1,y1) and E2(x2,y2) and given two control points C1(x3,y3) and C2(x4,y4), find the 8 cubic parametric coefficients ax, bx, cx, dx, ay, by, cy, dy for the curve whose X and Y coordinates are parameterised by the cubic equations: in which t is the variable parameter. The domain for t may be assumed to be the closed interval [0,1]. We require the following four conditions hold:

  7. Recall:

  8. While this underdetermined system can be solved, we will instead rewrite the form of our parametric equations for the X and Y coordinates of points on the curve:

  9. The Midpoint Property of Bezier Cubic Curves

  10. Point M's coordinates can also be found after first computing five other midpoints. The points M1, and M2, and M3 are the midpoints of the three segments that were originally drawn and connecting the original four points E1, C1, and C2, and E2.

  11. We can then draw the two segments which connect the three midpoints M1, M2, and M3. These two segments also have midpoints which we label as M4 and M5. The segment connecting M4 and M5 also has a midpoint and it is surprising that this point is the same M that is found when we let t = ½ in the above coordinate equations. To prove this for yourself all you need do is calculate all the midpoint coordinates, an easy exercise.

More Related