Curve Modeling Bézier Curves

Slides:



Advertisements
Similar presentations
Lecture Notes #11 Curves and Surfaces II
Advertisements

Computer Graphics (Spring 2008) COMS 4160, Lecture 6: Curves 1
2002 by Jim X. Chen: Bezier Curve Bezier Curve.
Lecture 10 Curves and Surfaces I
Cubic Curves CSE167: Computer Graphics Instructor: Steve Rotenberg UCSD, Fall 2006.
ICS 415 Computer Graphics Bézier Splines (Chapter 8)
CS 445/645 Fall 2001 Hermite and Bézier Splines. Specifying Curves Control Points –A set of points that influence the curve’s shape Knots –Control points.
© University of Wisconsin, CS559 Spring 2004
Jehee Lee Seoul National University
B-Spline Blending Functions
Dr. S.M. Malaek Assistant: M. Younesi
1 Curves and Surfaces. 2 Representation of Curves & Surfaces Polygon Meshes Parametric Cubic Curves Parametric Bi-Cubic Surfaces Quadric Surfaces Specialized.
Bezier Curves and Splines David Eno MAT 499 Fall ‘06.
Slide 127 October 1999CS Computer Graphics (Top Changwatchai) Review of Spline Concepts Sections 10-6 to in Hearn & Baker Splines can be 2D.
Lecture 29 of 42 Bezier Curves and Splines Wednesday, 02 April 2008
Informationsteknologi Monday, December 10, 2007Computer Graphics - Class 161 Today’s class Curve fitting Evaluators Surfaces.
Rational Bezier Curves
Modelling. Outline  Modelling methods  Editing models – adding detail  Polygonal models  Representing curves  Patched surfaces.
1 Lecture 13 Modeling Curved Lines and Surfaces. 2 Types of Surfaces Ruled Surfaces B-Splines and Bezier Curves Surfaces of Revolution.
1 Dr. Scott Schaefer The Bernstein Basis and Bezier Curves.
Cubic Bezier and B-Spline Curves
A story about Non Uniform Rational B-Splines E. Shcherbakov.
Computer Graphics 12: Spline Representations
Modelling: Curves Week 11, Wed Mar 23
RASTER CONVERSION ALGORITHMS FOR CURVES: 2D SPLINES 2D Splines - Bézier curves - Spline curves.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Curves Week 13, Mon 24 Nov 2003.
Bezier and Spline Curves and Surfaces CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
Designing Parametric Cubic Curves
Splines III – Bézier Curves
11/19/02 (c) 2002, University of Wisconsin, CS 559 Last Time Many, many modeling techniques –Polygon meshes –Parametric instancing –Hierarchical modeling.
Curve Modeling B-Spline Curves
A D V A N C E D C O M P U T E R G R A P H I C S CMSC 635 January 15, 2013 Spline curves 1/23 Curves and Surfaces.
Interactive Graphics Lecture 9: Slide 1 Interactive Graphics Lecture 9: Introduction to Spline Curves.
(Spline, Bezier, B-Spline)
V. Space Curves Types of curves Explicit Implicit Parametric.
Introduction to Computer Graphics with WebGL
Spline Representations
1 Dr. Scott Schaefer Smooth Curves. 2/109 Smooth Curves Interpolation  Interpolation through Linear Algebra  Lagrange interpolation Bezier curves B-spline.
Quadratic Surfaces. SPLINE REPRESENTATIONS a spline is a flexible strip used to produce a smooth curve through a designated set of points. We.
Chapter 4 Representations of Curves and Surfaces.
University of Texas at Austin CS384G - Computer Graphics Fall 2008 Don Fussell Parametric Curves.
Parametric Surfaces Define points on the surface in terms of two parameters Simplest case: bilinear interpolation s t s x(s,t)x(s,t) P 0,0 P 1,0 P 1,1.
CS 376 Introduction to Computer Graphics 04 / 25 / 2007 Instructor: Michael Eckmann.
Representation of Curves & Surfaces Prof. Lizhuang Ma Shanghai Jiao Tong University.
04/18/02(c) 2002 University of Wisconsin Last Time Hermite Curves Bezier Curves.
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.
Computing & Information Sciences Kansas State University Lecture 31 of 42CIS 636/736: (Introduction to) Computer Graphics Lecture 32 of 42 Wednesday, 11.
11/26/02(C) University of Wisconsin Last Time BSplines.
(c) 2002 University of Wisconsin
Slide 129 October 1999CS Computer Graphics (Top Changwatchai) Bézier Curves - Results of Derivation Tangents at endpoints are equal to endpoint slopes.
Designing Parametric Cubic Curves 1. 2 Objectives Introduce types of curves ­Interpolating ­Hermite ­Bezier ­B-spline Analyze their performance.
CS 450: Computer Graphics PARAMETRIC SPLINES AND SURFACES
Splines Sang Il Park Sejong University. Particle Motion A curve in 3-dimensional space World coordinates.
CS 325 Computer Graphics 04 / 30 / 2010 Instructor: Michael Eckmann.
Rendering Bezier Curves (1) Evaluate the curve at a fixed set of parameter values and join the points with straight lines Advantage: Very simple Disadvantages:
Surface Modeling Parametric Surfaces Dr. S.M. Malaek Assistant: M. Younesi.
Curves University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2013 Tamara Munzner.
CS552: Computer Graphics Lecture 19: Bezier Curves.
Object Modeling: Curves and Surfaces CEng 477 Introduction to Computer Graphics.
Introduction to Parametric Curve and Surface Modeling.
© University of Wisconsin, CS559 Spring 2004
Computer Graphics Lecture 38
Curve & Surface.
(Spline, Bezier, B-Spline)
© University of Wisconsin, CS559 Fall 2004
© University of Wisconsin, CS559 Spring 2004
Implicit Functions Some surfaces can be represented as the vanishing points of functions (defined over 3D space) Places where a function f(x,y,z)=0 Some.
Three-Dimensional Object Representation
Introduction to Parametric Curve and Surface Modeling
Type to enter a caption. Computer Graphics Week 10 Lecture 2.
Presentation transcript:

Curve Modeling Bézier Curves Dr. S.M. Malaek Assistant: M. Younesi

Question: Why do we need new forms of parametric curves? Introduction Question: Why do we need new forms of parametric curves? Answer: Those parametric curves discussed are not very geometric.

Introduction Given such a parametric form, it is difficult to know the underlying geometry it represents without some further analysis. It is almost impossible to predict the change of shape if one or more coefficient are modified.

Introduction In practice, designers or users usually do not care about the underlying mathematics and equation.

Intuitive: We expect that every step. Introduction A system that supports users to design curves must be: Intuitive: We expect that every step. Flexible: The system should provide the users with more control for designing and editing the shape of a curve. Easy: The way of creating and editing a curve should be easy.

Introduction Unified Approach: The way of representing, creating and editing different types of curves (e,g., lines, conic sections and cubic curves) must be the same. Invariant: The represented curve will not change its geometry under geometric transformation (translation, rotation, …)

Introduction Bézier, B-spline and NURBS curves advantage: A user layouts a set of control points for the system. A user can change the positions of some control points and some other characteristics for modifying the shape of curve.

Introduction If necessary, a user can add control points. They are very geometric, intuitive. The transition from curve to surface will not cause much difficulty.

Bézier Curves

Bézier Curves Bézier splines are: spline approximation method; useful and convenient for curve and surface design; easy to implement; available in Cad system, graphic package, drawing and painting packages.

Bézier Curves In general, a Bézier curve section can be fitted to any number of control points. The number of control points to be approximated and their relative position determine the degree of the Bézier polynomial.

Bézier Curves Given n+1 control point positions: These coordinate points can be blended to produced the following position vector C(u), which describes the path of an approximating Bézier polynomial function between P0 and Pn.

Properties Bézier ‍Curves of Bézier ‍Curves

Properties of a Bézier ‍Curve The degree of a Bézier curve defined by n+1 control points is n: Parabola Curve Cubic Curve Cubic Curve Cubic Curve

Properties of a Bézier ‍Curve The curve passes though the first and the last control point C(u) passes through P0 and Pn.

Properties of a Bézier ‍‍‍Curve Bézier curves are tangent to their first and last edges of control polyline. 1 2 3 4 5 8 7 6 10 9

Properties of a Bézier Curve The Bézier curve lies completely in the convex hull of the given control points. Note that not all control points are on the boundary of the convex hull. For example, control points 3, 4, 5, 6, 8 and 9 are in the interior. The curve, except for the first two endpoints, lies completely in the convex hull.

Properties of a Bézier ‍‍Curve Moving control points:

Properties of a Bézier ‍‍Curve Moving control points:

Bézier Curves The point that corresponds to u on the Bézier curve is the "weighted" average of all control points, where the weights are the coefficients Bk,n(u).

Design Techniques Using Bézier ‍Curve (Weights) ‍‍Multiple control points at a single coordinate position gives more weight to that position.

Design Techniques Using Bézier ‍Curve (Closed Curves) ‍‍Closed Bézier curves are generated by specifying the first and the last control points at the same position. 1 2 3 4 5 6 7 8 ‍‍Note: Bézier curves are polynomials which cannot represent circles and ellipses.

Properties of a Bézier Curve If an affine transformation is applied to a Bézier curve, the result can be constructed from the affine images of its control points.

Construction Bézier ‍Curves of Bézier ‍Curves

Bézier Curves Given n+1 control point positions: The Bézier blending functions are the Bernstein polynomials: The C(n,k) are the binomial coefficients:

Properties of a Bézier Curve All basis functions are positive and their sum is always 1

Example Cubic Bézier Curves Cubic Bézier curves are generated with four control points. The four blending functions for cubic Bézier curves (n=3):

Design Techniques Using Bézier ‍Curve (Complicated curves)

Design Techniques Using Bézier ‍Curve (Complicated curves) When complicated curves are to be generated, they can be formed by piecing several Bézier sections of lower degree together. Piecing together smaller sections gives us better control over the shape of the curve in small region.

Design Techniques Using Bézier ‍Curve (Complicated curves) Since Bézier curves pass through endpoints; it is easy to match curve sections (C0 continuity) Zero order continuity: P´0=P2

Design Techniques Using Bézier ‍Curve (Complicated curves) Since the tangent to the curve at an endpoint is along the line joining that endpoint to the adjacent control point;

Design Techniques Using Bézier ‍Curve (Complicated curves) To obtain C1 continuity between curve sections, we can pick control points P´0 and P´1 of a new section to be along the same straight line as control points Pn-1 and Pn of the previous section First order continuity: P1, P2, and P´1 collinear.

Design Techniques Using Bézier ‍Curve (Complicated curves) This relation states that to achieve C1 continuity at the joining point the ratio of the length of the last leg of the first curve (i.e., |pm - pm-1|) and the length of the first leg of the second curve (i.e., |q1 - q0|) must be n/m. Since the degrees m and n are fixed, we can adjust the positions of pm-1 or q1 on the same line so that the above relation is satisfied

Design Techniques Using Bézier ‍Curve (Complicated curves) The left curve is of degree 4, while the right curve is of degree 7. But, the ratio of the last leg of the left curve and the first leg of the second curve seems near 1 rather than 7/4=1.75. To achieve C1 continuity, we should increase (resp., decrease) the length of the last (resp. first) leg of the left (resp., right). However, they are G1 continuous

Cubic Bézier Curves

Cubic Bézier Curves Cubic Bézier curves gives reasonable design flexibility while avoiding the increased calculations needed with higher order polynomials.

Cubic Bézier Curves Cubic Bézier curves are generated with four control points. The four blending functions for cubic Bézier curves (n=3):

Cubic Bézier Curves At u=0, B0,3=1, and at u=1, B3,3=1. thus, the curve will always pass through control points P0 and P3. The functions B1,3 and B2,3, influence the shape of the curve at intermediate values of parameter u, so that the resulting curve tends toward points P1 and P3. At u=1/3, B1,3 is maximum, and at u=2/3, B2,3 is maximum.

Cubic Bézier Curves At the end positions of the cubic Bézier curve, The parametric first and second derivatives are: With C1 and C2 continuity between sections, and by expanding the polynomial expressions for the blending functions: the cubic Bézier point function in the matrix form:

Finding a point on a Bézier Curve: De Casteljau's Algorithm

Finding a point on a Bézier Curve A simple way to find the point C(u) on the curve for a particular u is to plug u into every basis function Compute the product of each basis function and its corresponding control point Add them together.

Finding a point on a Bézier Curve De Casteljau's Algoritm The fundamental concept of de Casteljau's algoritm is to choose a point C in line segment AB such that C divides the line segment AB in a ratio of u:1-u.

Finding a point on a Bézier Curve De Casteljau's Algoritm The vector from A to B is B-A. u is a ratio in the range of 0 and 1, point C is located at u(B-A). Taking the position of A into consideration, point C is A+u(B-A)=(1-u)A+uB

De Casteljau's Algoritm Casteljau's algorithm: we want to find C(u), where u is in [0,1]. Starting with the first polyline, 00-01-02-03…-0n, use the formula to find a point 1i on the leg from 0i to 0(i+1) that divides the line segment in a ratio of u:1-u. we ill obtain n point 10,11,12,…,1(n-1), they defind a new polyline of n-1 legs.

De Casteljau's Algoritm Casteljau's algorithm: we want to find C(u), where u is in [0,1]. Starting with the first polyline, 00-01-02-03…-0n, use the formula to find a point 1i on the leg from 0i to 0(i+1) that divides the line segment in a ratio of u:1-u. we ill obtain n point 10,11,12,…,1(n-1), they defind a new polyline of n-1 legs.

De Casteljau's Algoritm Apply the procedure to this new polyline and we shall get a third polyline of n-1 points 20-21-…,2(n-2) and n-2 legs.

De Casteljau's Algoritm Apply the procedure to this new polyline and we shall get a fourth polyline of n-1 points 30-31-…,3(n-3) and n-3 legs.

De Casteljau's Algoritm From this fourth polyline, we have the fifth one of two points 40 and 41.

De Casteljau's Algoritm Do it once more, and we have 50, the point C(0.4) on the curve. De Casteljau proved that this is the point C(u) on the curve that corresponds to u.

De Casteljau's Algoritm Actual Compution From the initial column, column 0, we compute column 1; from column 1 we obtain column 2 and so on. After n applications we shall arrive at a single point n0 and this is the point on the curve.

Subdivision a Bézier Curve

Subdivision a Bézier Curve Given s set of n+1 control points P0,p1,P2, …,Pn and a parameter value u in the range of 0 and 1, we wannt to find two sets of n+1 control points Q0,Q1,Q2, ..,Qn and R0,R1,R2,…,Rn such that the Bézier curve definde by Qi’s (resp. Ri’s) is the piece of the original Bézier curve on [0,u] (resp., [u,1]).

Subdivision a Bézier Curve Left polyline consists of points P00=P0,P10,P20,P30,P40,P50 and P60=C(u). Right polyline consist of points P60=C(u),P51,P42,P33,P24,P15 and P06=P6.

Subdivision a Bézier Curve

Subdivision a Bézier Curve

Subdivision a Bézier Curve Note that since the line segment defined by 50 and 51 is tangent to the curve at point 60, the last leg of the left curve (i.e, point 50 to point 60) is tangent to the left curve, and the first leg on the right curve (i.e, point 60 to point 51) is tangent to the right curve.

Subdivision a Bézier Curve Why Do we need curve Subdivision? Used for: Computating the intersection of two Bézier curves Rendering Bézier curves Making curve design easier.