Modeling Curves and Surfaces Graphics I Modeling for Computer Graphics!? 1
How can we generate this kind of objects? Umm!? Mathematical Modeling! S Do not worry too much about your difficulties in mathematics, I can assure you that mine are still greater. 2
Our modeling plan Parametric curves o Bezier o B-Spines (subdivision methods) How to extend curves to the surfaces, images, volumetric data sets Parametric versus implicit modeling Simple example: Circle o parametric t Q x(t) y(t) Q 3
Parametric versus implicit modeling Polynomial curves Polynomials are fundamental mathematical objects Easy and efficient to compute standard representation Polynomial curves of degree one, two and three where 4
User input for a polynomial curve Formula!!! No way Giving 2D(or 3D) points as Pi a good idea Pi : point => arbitrary combination of them is not possible. Why? Affine combination It is not possible to satisfy this condition by this set of polynomials Bernstein basis functions Terms in the expansion of: Second degree polynomials Third degree polynomials Resulting curves 5
Bezier Models Bezier curve properties Decasteljau algorithm Subdivision method Flaws of Bezier modeling Graphics I Bezier Model P.Bezier, 1960, Unisurf in Renault automobile designing. Mathematical definition Q(u) Modeling Point in or Old CAD and graphics software curve Postscript METAFONT 6
Bezier Curve Definition u is the parameter Berenstein polynomial of order d :Control points ( inputs) Bezier Curve Details Bezier curve of order 1 Bezier curve of order 3 Bezier curve of order 2 7
Cubic Bezier Curve properties 1. is a polynomial curve with the domain [0,1] 2. 3. 4. 5. Properties of Non-negative polynomial of order d 8
Convex Hull What is the Convex Hull? Given a set of points (in ) The smallest convex polyhedral that includes all the points given Implementation (brute force) Input P[i], d //P[i]: control point, d : degree, u : parameter for u=0 to 1 step 0.01 for i=0 to d b = Berenstein( i, d, u ) q = q + b * P[i] end plot(q); end This program isn t efficient Redundant computations High number of control points High degree polynomial High degree polynomial Unstable computation 9
de Casteljau Algorithm Avoid direct evaluating of polynomials Geometric interpretation Consider a planer cubic at u 1 u column by column updating rule Pseudo Code Input P[j], d, u //P[j] : control point, d : degree, u : parameter //output will be Q(u) for i = 1 to d for j = 0 to d-i P[j] =(1-u)*P[j] + u*p[j+1] end end Output??? Why is this algorithm correct? 10
Some Observation on Cubic Case After one step of decasteljue algorithm for Obtaining 4 green points 4 purple points Where Small left Bezier curve: Small right Bezier curve: Original Bezier curve Divided and conquer method A discrete approach We start with 4 points We will obtain 8 new points 7 new points New points: New points are closer to the curve We can repeat for any 4 points in the new points sets And initial polyline is replaced by a finer polyline Subdivision method 11
Matrix form Unit summation of any row. Non negative elements. Banded structure. L0, L1, L2,L3, R1, R2 and R3 can be found from the decasteljau algorithm 12
Subdivision approach versus functional approach Bezier Curve Functional approach Subdivision Approach Weakness of Bezier curves High degree polynomial How can we increase the controlling on the curve without adding control points? Composite Bezier curve: join Bezier curve segments. Apply some constraints at the connection points. What are these constrains? o Positional Continuity = zero degree continuity o Same direction tangents = first degree continuity Any other weakness? 13
instability! B-spline Subdivisions Spline curves Chaikin Subdivision: quadratic B-spline Cubic B-spline subdivision Tensor product surfaces Graphics I 14