600 likes | 620 Views
Explore the concepts of wireframe, surface, and solid modeling in 3D graphics. Understand the importance of topology and geometry in defining models and learn about curve representations like Hermite curves and cubic splines.
E N D
Lecture 4a Wireframe and Curve Lecture 3
Type of modeling • Wire frame • Surface • Solid Lecture 3
Do not confuse (Visualization) Lecture 3
What we cover? • Type of entities • Topologies and geometries • Why we need certain number of commands to model • Parametric entities and its development toward surface Lecture 3
Types of entity Lecture 3
Definition Topology and geometry • Topology is the connectivity that associates with entities. Topology states that L1 shares vertex with L2 when L1 and L2 is two connected lines • Geometry is description of the topology in space. Geometry states that the coordinates of the vertices. Geometric modeling requires both topology and geometry as its low-level model definition. Lecture 3
Importance of topology and geometric in model definition • Make each model unique, no two models has the same low-level definition • Determine the method to build the entities • Determine the manipulation of the entities • Determine the position of the entities in space Lecture 3
Understanding topology and geometry Topology has vertical relationship with other topology. Geometry has horizontal relationship with topology. Line Topology Geometry EdgeCurve VertexCoordinates Lecture 3
Understanding topology and geometry – con’t Same geometry but different topology Same topology but different geometry Lecture 3
Geometry of curves • The geometry of the curves is defined by their arrays of points or by their mathematical representations. • Mathematical representation is preferable description due to its practicality for computational purposes. • The mathematical representation can be divided into two types; implicit and parametric Lecture 3
Examples: Single entities P0( x0, y0) TOPOLOGY GEOMETRY EDGE (line) CURVE (p(t)) EDGE (line) P1( x1, y1) VERTEX (2 points) COORDINATES (x, y) Based on line topology and geometry: its needs 2 vertex Circle: 1 vertex and the radius will be inserted to the curve Arc: 2 vertices and the radius will be inserted to the curve Lecture 3
Examples: Multiple entities P0 P1 Topology and geometry will be stored separately P2 P3 Lecture 3
Examples: Further Understanding P4 P0 P1 P5 P7 P2 P3 P6 Profile A Profile B DISCUSS Will Profile A and B has the same topological and geometrical data? If two unequal lines will have the same topological and geometrical data? Lecture 3
Lecture 4a Curve Representations Lecture 3
Curve representation: implicit • Implicit f(x,y) = 0 f(x,y,z) = 0 Lecture 3
Curve representation: parametric • Parametric x = x(t) y = y(t) z = z(t) where Lecture 3
Circle: Implicit and Parametric representation Implicit Representation of circle For x = 0; x <= R; x = x+ dx y = sqrt (R^2 – x^2) Plotted point will be [ x , sqrt (R^2 – x^2) ] Lecture 3
Circle: Implicit and Parametric representation Parametric For t = 0; x <= 1; t = t+ dt x = r * cos (2*pi*t) y = r * sin (2*pi*t) Plotted point will be (for every t until t = 1) [r * cos (2*pi*t) , r * sin (2*pi*t)] To have more points, make dt smaller If z(t) = 2*t is added to parametric eq. What is the output? Lecture 3
Circle: Implicit and Parametric representation Parametric Implicit Parametric representation generates evenly spaced points and hence generates more smooth curves. Lecture 3
Synthetic curve representation • Interpolation method Cubic (Hermite), cubic spline (piecewise polynomial) • Approximation method Bezier, B-Spline, Non-rational & rational curve, uniform and non-uniform Lecture 3
Hermite Curve Parametric Cubic Equation P(t): point on the curve ai:algebraic coefficient Lecture 3
Hermite Curve: con’t t = 0 P(0) = a0 eq1 t = 1 P(1) = a3 + a2 + a1 + a0 eq2 Set the tangent at P(0) and P(1) t = 0 P’(0) = a1 eq3 t =1 P’(1) = 3a3 + 2a2 + a1 eq4 Set the equation a0, a1, a3 and a4 in terms of P(0), P(1), P’(0) and P’(1) and insert into the parametric cubic equation. P(t) = (2t3 – 3t2 + 1)P(0) + (-2t3 + 3t2)P(1) + (t3 – 2t2 + t)P’(0) + (t3 – t2)P’(1) Lecture 3
Hermite Curve: con’t x(t) = (2t3 – 3t2 + 1)x(0) + (-2t3 + 3t2)x(1) + (t3 – 2t2 + t)x’(0) + (t3 – t2)x’(1) y(t) = (2t3 – 3t2 + 1)y(0) + (-2t3 + 3t2)y(1) + (t3 – 2t2 + t)y’(0) + (t3 – t2)y’(1) Used constraint: slope of the end point. Matrix representation Lecture 3
Hermite Curve: Draw the curve For t = 0; t <= 1 ; t = t +dt P0 = (0 , 0 ) P1 = (5 , 7 ) P0’ = ( 1 , 0 ) P1’ = ( 0, 1) The list of vertices will be Lecture 3
Hermite Curve: Examples P0= 0,0 P1 = 1,0 P0’= 0,1 P1’ = 0, -1 P0= 0,0 P1 = 1,0 P0’= 1,1 P1’ = 1, 1 Lecture 3
Hermite Curve: Characteristics Lecture 3
Hermite Curve: Application Lecture 3
Cubic Spline What is spline? Spline is introduced to replace flexible curve. Flexible curve enables the continuity of the curve to second derivative (C2) Cubic spline is a special for parametric cubic (first derivative at each ends of the segment) with ensure continuity at second derivative. Therefore, smoother curve is generated. Lecture 3
Curve continuity P(t) P’(t) P’’(t) Lecture 3
Cubic spline: con’t Cubic polynomial equation Second derivative At Pi-1 end point of segment curve i-1 when t =1 start point of segment curve I when t = 0 P”i-1(1) = P”i(0) At Pi+1 end point of segment curve i when t =1 start point of segment curve i+1 when t = 0 P”i(1) = P”i+1(0) Lecture 3
Cubic spline: con’t Cubic spline equation Two methods to set the tangent of the first and last vertex 1. Predefined tangents 2. Natural Cubic Spline: tangents are set to zero Lecture 3
Cubic spline: con’t • Cubic spline with known tangents 2. Natural Cubic Spline: tangents are set to zero Lecture 3
Cubic spline: How to draw the curve Equation above will calculate the tangents at each piecewise. Each piecewise is Hermite Curve No of vertex = n No of Hermite curve is n – 1 Therefore For i = 0; i <= n -1; i = i+1 draw hermite Curve ( P0 = i, P1 = i+1, P0’ = P’(i), P1’= P’(i+1) Lecture 3
Cubic spline: Applications Additional point is added 15 curves Lecture 3
Interpolation vs approximation Interpolation It is originated for data-fitting. The curve generated will go through the vertices Approximation The curve is not necessarily passing through all of the vertices Generate free-form surface. Suitable to model car body, hull etc. Blending functions are used to create smooth edges at the joints Lecture 3
Bezier Curve Blending Function Lecture 3
Bezier Curve: Cubic Equation Blending Function Lecture 3
Bezier Curve: Cubic Equation Blending Function Cubic Equation for Bezier Curve is Lecture 3
Bezier Curve: example Given four points, P0 (0,0), P1(2,1), P3(4,4), and P3(6,0). Draw the generated Bezier Curve. Lecture 3
Bezier Curve The result of moving P1. Lecture 3
B-Spline: Blending Functions Lecture 3
Blending Functions: Cubic Lecture 3
Blending Functions: Cubic Lecture 3
Blending Functions: Cubic Lecture 3
B-Spline 4 knots will draw one of three segment Therefore, two additional points needed to draw a complete B-Spline goes through the start and end knots
B-Spline: Applications Since B-Spline always generates concave curve, one of suitable application path planning.
B-Spline (Example) Draw the B-Spline curve based on P0 (0,0), P1 (2, 1), P2 (4, 4), and P3(6, 0) Lecture 3
B-Spline The results of moving P1 Lecture 3
B-Spline To complete B-Spline P-1 and P4 must be added. Lecture 3