Lecture 17 Parametric Curves And Surfaces

Transcription

Parametric Representationof Curves and SurfacesHow does the computercompute curves and surfaces?MAE 455 Computer-Aided Design and Drafting

Types of Curve Equations Implicit Formx2 y2 R2 , z 0 Explicit Formy ( x) R 2 x 2 , z 0 Parametric Formx(θ ) R cos θ ,y (θ ) R sin θ , z (θ ) 0CAD uses primarily the parametric form.MAE 455 Computer-Aided Design and Drafting2

Straight Line & Conic Curves Straight Line: x(u) x0 dx u Circle: Ellipse: Hyperbola: Parabola:y(u) y0 dy ux(u) R cosuy(u) R sinux(u) a cosuy(u) b sinux(u) a coshuy(u) b sinhux(u) c u2y(u) uz(u) z0 dz uz(u) 0z(u) 0z(u) 0z(u) 0Line segments and conic arcs are established by specifying ranges for u(e.g., 0 u π/2; or 0 u 1).Transformation equations are used to rotate and translate the curves to the desiredMAE 455 Computer-Aided Design and Drafting3orientation and location.

Polynomial Freeform Curves Freeform curves (and even straight lines and arcs) arerepresented in CAD using polynomials. E.g.: x(u ) P(u ) y (u ) z (u ) a0, 0 a1,0u a2,0u 2 a3, 0u 3 23 a0,1 a1,1u a2,1u a3,1u a0, 2 a1, 2u a2, 2u 2 a3, 2u 3 a0, 0 a1, 0 a2, 0 a3, 0 2 3 a0,1 a1,1 u a2,1 u a3,1 u a0, 2 a1, 2 a2, 2 a3, 2 2 a 0 a1u a 2u a 3uMAE 455 Computer-Aided Design and Drafting43(0 u 1)

B-Spline Curve The coefficients a0, a1, a2, a3 are hard for a designer to specifybecause the geometric affect is not intuitive. CAD software therefore uses “B-Spline” curves. B-Spline curves are controlled using “control points” .“control” polylineB-Spline curve with:P1– Degree: 3– Num. control points: 4P2P3 (u 1)P0 (u 0)MAE 455 Computer-Aided Design and Drafting5“control points”(“poles” in NX)

B-Spline Curve Equation The B-spline curve equation is: n is the num. control points – 1 k is the degree 1 t are a series of increasingnumbers (“knots”). Note that at each point of the curve each control point Pihas an influence given by Ni,k(u).MAE 455 Computer-Aided Design and Drafting6

B-Spline Curve Equation Using a smaller degree limits the influence of each control point.N0,8Degree: 7Num. control points: 8N7,8N1,8N2,8 N3,8N4,8N5,8 N6,8uDegree: 3Num. control points: 8N0,4N1,4 N2,4N3,4Blue triangles represent knotsMAE 455 Computer-Aided Design and Drafting7N4,4N5,4N7,4N6,4u

B-Spline Curve Equation Making the degree smaller brings the curve closer to thecontrol points.Evaluatingthis pointThe colored linesshow the influenceof the control points.u 0u tlastDegree: 7; Num. control points: 8u 0u tlastDegree: 3; Num. control points: 8 Note that the B-spline curve is composed of n - k 2 segments, eachof degree k-1. Here the segments are shown separated by the pinkMAE455 Computer-AidedDesignand Drafting8circles(which alsorepresentknot locations).

Closed versus Open Curves A B-Spline curve can be “open” or “closed”“closed”“open”MAE 455 Computer-Aided Design and Drafting9

B-Spline Curve Properties Open curves always pass through the first and last point. The tangent at first point is given by the direction from thefirst control point to the second. The tangent at last point is given by the direction from thesecond last control point to the last. The same curve will result if the control points are createdin the reverse order (only u 0 will be at the reverse end). The curve is always inside the convex hull of the controlpolygon:Figure is from: K. Lee, “Principles of CAD/CAM/CAE Systems,” Addison-Wesley, 1999MAE 455 Computer-Aided Design and Drafting10

B-Spline Curve Properties Be careful with using too high a degree.Higher order curves are inherently morewavy.Second order interpolationEleventh order interpolation Also, if the degree is too high, moving a controlpoint at the beginning of the curve will result inchanges to the curve at the other end.MAE 455 Computer-Aided Design and Drafting11

NURBS curves NURBS means “Non-uniform Rational B-Spline”. NURBS have a weighting factor hi associated with eachcontrol point. In NURBS curves the knot values do not have to beuniformly spaced. NURBS curves are useful because they allow exactrepresentation of conic curves.h1 0.707h0 1MAE 455 Computer-Aided Design and Drafting12h2 1

Types of Surface Equations Non-parametric – implicit222x y z R– e.g. sphere:2 Non-parametric - explicity ( x, z ) R 2 x 2 z 2 Parametric x(u , v) R cos(u ) cos(v) P(u , v) y (u , v) R sin(u ) cos(v) z (u , v) R sin(v) MAE 455 Computer-Aided Design and Drafting13

Primitive Surfaces PlaneP(u, v) u i v j 0 kzzvyvu CylinderuyRxP(u, v) R cos u i R sin u j v kMAE 455 Computer-Aided Design and Drafting14x

Primitive Surfaces Plane Cylinder SphereP(u, v) u i v j 0 k Cone TorusP(u, v) m v cos u i m v sin u j v kP(u, v) R cos u i R sin u j v kP(u, v) R cos u cos v i R sin u cos v j R sin v kP(u, v) (R r cos v) cos u i (R r cos v) sin u j r sin v kTransformation equations are used to rotate and translatethese surfaces into the desired orientation and location.MAE 455 Computer-Aided Design and Drafting15

The B-Spline Surface The B-Spline surface isan extension of the BSpline curve concept toone higher dimension. It uses a grid of controlpoints, evaluated in uand v to surface points.MAE 455 Computer-Aided Design and Drafting16

B-Spline SurfaceProperties: Boundaries are B-Spline curves. Intuitive control of surface interior. Derivatives (surface normals) can be evaluatedusing same algorithm used to evaluate points. Surface is inside convex hull of control points NURBS surfaces can exactly represent roundedsurfaces (e.g., cylindrical and spherical surfaces).MAE 455 Computer-Aided Design and Drafting17

Extrude Operation1. Start with NURBS curve:2. Duplicate the control points.3. Create another duplicaterow of control pointstranslated by da.4. Duplicate the weightings ineach row.MAE 455 Computer-Aided Design and Drafting18P0, j P jP1, j P j dah0, j h1, j h j

MAE 455 Computer-Aided Design and Drafting u 0 u tlast u 0 u tlast 8 B-Spline Curve Equation Degree: 7; Num. control points: 8 Evaluating this point Note that the B-spline curve is composed of n - k 2 segments, each of degree k-1. Here the segments are shown separated b