Xem mẫu

Đường cong trong không gian 3D CURVE Đường cong - Curve Why use curves? Quỹ đạo chuyển động của 1 điểm trong không gian Đường cong biểu diễn Điểm -curve represents points: Điểm Biểu diễnvà kiểm soát đường cong -Points represent-and control-the curve. Cách tiếp cận này là cơ sở của lĩnh vực Computer Aided Geometric Design (CAGD). (c) SE/FIT/HUT 2002 Phân loại Trên cơ sở ràng buộc giữa điểm và đường trong cả ứng dụng khoa học và thiết kế ta co thể phân làm 2 loại: Xấp xỉ-Approximation - Được ứng dụng trong mô hình hoá hình học Nội suy-Interpolation Trong thiết kế nôi suy là cần thiết với các đối tượng nhưng không phù hợp với các đối tượng có hình dáng bất kỳ "free form“. (c) SE/FIT/HUT 2002 3 Đường cong tham biến Biểu diễn các đường cong tham biến Parametric representation: x = x(t), y = y(t), z = z(t) overcomes problems with explicit and implicit forms no geometric slopes (which may be infinite) parametric tangent vectors instead (never infinite) a curve is approximated by a piecewise polynomial curve Define a parameter space 1D for curves 2D for surfaces Define a mapping from parameter space to 3D points A function that takes parameter values and gives back 3D points The result is a parametric curve or surface Mapping F :t → (x, y, z) (c) SE/FIT/HUT 2002 2 Biểu diễn Đường cong Tường minh y=f(x) y = f(x), z = g(x) impossible to get multiple values for a single x • break curves like circles and ellipses into segments not invariant with rotation • rotation might require further segment breaking problem with curves with vertical tangents • infinite slope is difficult to represent Không tường minh f(x,y)=0 - Implicit equations: f(x,y,z) = 0 equation may have more solutions than we want • circle: x² + y² = 1, half circle: ? problem to join curve segments together • difficult to determine if their tangent directions agree at their joint pointE/FIT/HUT 2002 4 Parametric Curves We have seen the parametric form for a line: 0 1 y = y0t +(1−t)y1 z = z t +(1−t)z Note that x, y and z are each given by an equation that involves: The parameter t Some user specified control points, x0 and x1 This is an example of a parametric curve 0 1 t (c) SE/FIT/HUT 2002 5 (c) SE/FIT/HUT 2002 6 Đường cong đa thức bậc ba Phải đảm bảo là đường cong không gian với 3 trục toạ độ x, y, z tránh được những tính toán phức tạp và những phần nhấp nhô ngoài ý muốn xuất hiện ở những đường đa thức bậc cao Why cubic? Đường cong bậc 3 x = a1 + b1u + c1u2 + d1u3 y = a2 + b2u + c2u2 + d2u3 z = a3 + b3u + c3u2 + d3u3 Với 3 điểm P0, P1, P2, P3 phương trình xác định P`1 p3 P1 p2 P`0 P1 P0 (c) SE/FIT/HUT 2002 7 P0 (c) SE/FIT/HUT 2002 8 Hermite Spline A spline is a parametric curve defined by control points The term spline dates from engineering drawing, where a spline was a piece of flexible wood used to draw smooth curves The control points are adjusted by the user to control the shape of the curve Phương pháp Hermite dựa trên cơ sở của cách biểu diễn Ferguson hay Coons năm 60 A Hermite spline is a curve for which the user provides: The endpoints of the curve The parametric derivatives of the curve at the endpoints • The parametric derivatives are dx/dt, dy/dt, dz/dt That is enough to define a cubic Hermite spline, more derivatives are required for higher order curves Đường cong Hermite p = p(u) = k0 + k1u + k2u2 + k3u3 p(u) = ∑kiui i∈n p và p ta có hai độ dốc p ’ và p ’ với u = 0 và u = 1 tại hai điểm đầu cuối của đoạn [0,1]. We have constraints: The curve must pass through p0 when u=0 The derivative must be p’0 when u=0 The curve must pass through p1 when u=1 The derivative must be p’1 when u=1 (c) SE/FIT/HUT 2002 9 (c) SE/FIT/HUT 2002 10 Basis Functions A point on a Hermite curve is obtained by multiplying each control point by some function and summing The functions are called basis functions Thay vào: p = p(u) = p (1-3u2+2u3) + p (3u2-2u3) + p0’(u-2u2+u3) + p1’(-u2+u3) p = p(u) = [ 1 u u2 u3 ] (c) SE/FIT/HUT 2002 11 (c) SE/FIT/HUT 2002 12 Đường cong Bezier Sử dụng điểm và các vector kiểm soát được độ dốc của đường cong tại nhưng điểm mà nó đi qua.(Hermit) không được thuận lợi cho việc thiết kế tương tác, không tiếp cận vào các độ dốc của đường cong bằng các giá trị số (Hermite). Paul Bezier, RENAULT, 1970 đường và bề mặt UNISURF po, p3 tương đương với p0, p1 trên đường Hermite. diểm trung gian p1, p2 được xác định bằng 1/3 theo độ dài của vector tiếp tuyến tại điểm po và p3 p0’ = 3(p1 – p0) p3’ = 3(p3 – p2) p = p(u) = p0(1-3u2+2u3) + p1(3u2-2u3) + p0’(u-2u2+u3) + p1’(-u2 + u3) p = p(u) = p0(1 - 3u + 3u2 - u3) + p1(3u-6u2-3u3) + p2(3u2 - 3u3) + p3u3 (c) SE/FIT/HUT 2002 13 (c) SE/FIT/HUT 2002 14 Biểu diễn Ma trận 1.2 1 0.8 0.6 0.4 0.2 0  1 0 0 −3 3 0 p = p(u) = [ 1 u u2 u3 ] 3 −6 3 −1 3 −3 B0 B1 B2 B3 0 p 0  p1  1  p3  Ưu điểm dễ dàng kiểm soát hi`nh dạng của đường cong hơn vector tiếp tuyến tại p0’ và p1’ của Hermite. Nằm trong đa giác kiểm soát với số điểm trung gian tuỳ ý( số bậc tuỳ ý) đi qua điểm đầu và điểm cuối của đa giác kiểm soát, tiếp xúc với cặp hai vector của đầu cuối đó (c) SE/FIT/HUT 2002 15 (c) SE/FIT/HUT 2002 16 Example Bezier Curves Sub-Dividing Bezier Curves P1 [UW] M012 M01 M12 P2 M0123 M123 M23 P0 P3 (c) SE/FIT/HUT 2002 17 (c) SE/FIT/HUT 2002 18 Sub-Dividing Bezier Curves Sub-Dividing Bezier Curves P1 P2 Step 1: Find the midpoints of the lines joining the original control vertices. Call them M01, M12, M23 Step 2: Find the midpoints of the lines joining M01, M12 and M12, M23. Call 012 123 Step 3: Find the midpoint of the line joining M012, M123. Call it M0123 The curve with control points P , M , M and M exactly follows the original curve from the point with t=0 to the point with t=0.5 The curve with control points M , M , M and P exactly follows the original curve from the point with t=0.5 to the point with t=1 P0 P3 (c) SE/FIT/HUT 2002 19 (c) SE/FIT/HUT 2002 20 de Casteljau’s Algorithm You can find the point on a Bezier curve for any parameter value t with a similar algorithm Say you want t=0.25, instead of taking midpoints take points 0.25 of the way P1 M12 P2 M23 t=0.25 Biểu thức Bezier-Bernstain Tổng quát hoá với n +1 điểm kiểm soát n p(u) = B,n (u)pi i=0 p′(u) = n n B,n−1(u)(pi+1 − P) i=0 B,n(u) = C(n,i)ui(1−u)n−i ... - tailieumienphi.vn
nguon tai.lieu . vn