Lectures 1234567 Computer Aided Design Hikmet Kocabaş, Prof., PhD. Istanbul Technical University
Computer Aided Design Prof. Dr. Hikmet Kocabas I.T.U. Faculty of Mechanical Engineering office no: 428 office phone: 0212-2931300 / 2468 e-mail: kocabash@itu.edu.tr web site: www.akademi.itu.edu.tr/kocabash Interests: Mechanical Design Finite Element Analysis Mechanism Simulation CAD – CAE – CAM
Intro. to Computer Graphic Systems Textbooks: Computer Aided Engineering Design, Anupam Saxena, Birendra Sahay, Springer, 2005 Engineering Design A Systematic Approach, G. Pahl, W. Beitz, Springer-Verlag, 2007
Lectures 1234567 Lecture 1 Intro. to Computer Graphic Systems Lecture 2 Geometry Lecture 3 Vector Algebra Lecture 4 Transformations Lecture 5 Curves Lecture 6 Surface Modeling Lecture 7 Solid Modeling
Computer Aided Design
Geometry solids A typical solid model is defined by solids, surfaces, curves, and points. Solids are bounded by surfaces. They represent solid objects. Surfaces are bounded by lines. They represent surfaces of solid objects, or planar or shell objects. Curves are bounded by points. They represent edges of objects. Points are locations in 3-D space. They represent vertices of objects. lines, curves, points surfaces
geometric elements
Geometry There is a built-in hierarchy among solid model entities. Points are the foundation entities. Curves are built from the points, Surfaces from curves, and Solids from surfaces. Points Curves Surfaces Solids Points Curves Surfaces Solids I’ll just change this line Curves Points Surfaces Solids OOPs!
Line (Combinations of Points) Let P1 and P2 be points in space. if 0 ≤ t ≤ 1 then P is somewhere on the line segment joining P1 and P2 . We may utilize the following notation P = P(t) = (1 - t) P1+ t P2 α2= t α1= 1- t 1 P1 P2 Linear interpolation P1 P2 P1+ t (P2 - P1) t (P2 - P1) P
Line (Combinations of Points) We can then define a combination of two points P1 and P2 to be P = α1 P1+ α2 P2 where α1 + α2 = 1 derive the transformation by setting α2 = t α2= t α1= 1- t 1 P1 P2 Linear interpolation P1 P2 P1+ t (P2 - P1) t (P2 - P1) P
Linear Surface We can generalize the line to define a combination of an arbitrary number of points. P = α1 P1+ α2 P2 + α3 P3 where α1 + α2 + α3 = 1 0 ≤ α1 , α2 , α3 ≤ 1 Illustration shows the point P generated when α1 = α2 = 1/4 α3 = 1/2 P2 P1 α3 (P3 - P1) P3 P α2 (P2 - P1)
Lecture 5 Curves Both Bézier curves and B-splines are polynomial parametric curves. Polynomial parametric forms can not represent some simple curves such as circles. Continuity
Curves Bézier curves and B-splines are generalized to rational Bézier curves and Non-Uniform Rational B-splines, or NURBS for short. Rational Bézier curves are more powerful than Bézier curves since the former now can represent circles and ellipses. Similarly, NURBS are more powerful than B-splines. The relationship among these NURBS B-spline Bezier Rational Bezier
de Casteljau’s Algorithm Curve Subdivision
Tangent, Normal, Curvature of a Curve
Degree Elevation of a Curve
Rational Bezier curve Effect of the weights of the control points of a Rational Bezier curve
Bezier curves n=3 C(n,i) = n! / ( i! (n-i)!) B(i,n,u) = C(n,i) ui (1-u)n-i P(u) = ∑ B(i,n,u) Pi i=0 n
Bezier curves The order of the degree of curve is variable and related to the number of points defining it. n+1 points define an n'th degree curve which permit higher-order continuity. Control points form the vertices of what is called characteristic polygon. Curve lies entirely within the convex hull defined by the polygon vertices. Only the first and the last control points or vertices of the polygon actually lie on the curve. The other vertices define the order, derivatives, and the shape of the curve. The curve is also always tangent to the first and last polygon segments. In addition, the curve shape tends to follow the polygon shape.
B-spline curves Piecewise Polynomials Approximating Splines Spline eq. P(u) = ∑ N(i,k,u) Pi i=0 n
B−spline Curves a B−spline curve is the union of a number of Bezier curves joining together with C − continuity.
B-Spline Surfaces
B-spline curves Since a NURBS curve is rational, circles, ellipses and N0,0 N1,0 N2,0 N3,0 N4,0 N5,0 N6,0 N7,0 N0,1 N1,1 N2,1 N3,1 N4,1 N5,1 N6,1 N0,2 N1,2 N2,2 N3,2 N4,2 N5,2 N0,3 N1,3 N2,3 N3,3 N4,3 N0,4 N1,4 N2,4 N3,4 B-spline curves Since a NURBS curve is rational, circles, ellipses and hyperbolas can be represented NURBS
De Boor’s Algorithm De Boor’s algorithm is implemented by repeated knot insertion.
Shape Editing The local modification property guarantees that only part of the curve will be affected when a control point changes its position. In fact, position change is parallel to the Movement of the control point.
Weight Change Increasing weight pulls the curve toward the selected control point. Decreasing weight pushes the curve away from the
Surface Modeling Control points Bezier, B−spline and NURBS surface is a tensor product surface and is the product of two curves. Surfaces are defined by a grid and have two sets of parameters, two sets of knots and so on.
Surface Modeling Surface by Recursive Subdivision Algorithm
Surface Modeling Surface subdivision
Surface Modeling Surface Reconstruction by Recursive Subdivision Curve-based design and Surface deformation
Surface Modeling Finite Element Simulation
Interpolation and Approximation
Surface Modeling Extension of curve modeling Parametric representation: p = p(u,v) which is equivalent to x = x(u,v) y = y(u,v) z = z(u,v)
Surface Modeling Defining a surface with hole
Surface Patch Isoparametric curves can be used for tool path generation.
Linearly Blended Coons Patch Surface is defined by linearly interpolating between the boundary curves Simple, but doesn’t allow adjacent patches to be joined smoothly P1 T(v) R(v) Q(u) S(u)
Linearly Blended Coons Patch T(v) R(v) Q(u) S(u) Linearly Blended Coons Patch P1(u,v) P2(u,v) P3(u,v) P(u,v) = + -
Bicubic Patch Extension of cubic curve 16 unknown coefficients – 16 boundary conditions Tangents and “twists” at corners of patch can be used Like Lagrange and Hermite curves, difficult to work with
Bezier Surfaces Bezier curves can be extended to surfaces Same problems as for Bezier curves: no local modification possible smooth transition between adjacent patches difficult to achieve Isoparametric curves used for tool path generation.
B-Spline Surfaces As with curves, B-spline surfaces are a generalization of Bezier surfaces The surface approximates a control polygon Open and closed surfaces can be represented
B-Spline Surfaces
Surfaces from Curves Tabulated cylinder (extrusion) Ruled surface (lofting or spined) Surface of revolution Swept surface Sculptured surface
Tabulated Cylinder Project curve along a vector In SolidWorks, created by extrusion Generating curve C P(u,v) = C(u)+ V(v) v u V(v) C(u) Vector V
Ruled Surface Linear interpolation between two edge curves Created by lofting through cross sections u v C1(u) C2(u) P(u,v) = (1-v) C1(u)+ v (C2(u) Edge curve 2 Edge curve 1 Linear interpolation
Surface of Revolution Revolve curve about an axis Axis C2(u) C1(u) v P(u,v) = C1(u)+ v (C2(u) – C1(u)) C2(u)
Swept Surface Defining curve swept along an arbitrary spine curve C2(v) P(u,v) = C1(u)+ C2(v) Spine
Lofted Surface Defining curve swept along Surface Pipe an arbitrary spine curve Defining curves Spine
Spined Surface
Sculptured Surface General surface Composed of connected surface patches
Fillets and Blends Often necessary to create a blend between intersecting surfaces Most common application is a fillet Fillet required here
Face Blend Fillet
Fillet between two selected surfaces Spined fillet with drive curve
Surface functions Curve in surface intersection Offset Surface Planar development of surfaces
Fillet between three surfaces Corner fillet
Fillet between three curves Triangular Surface by Coon patch
Sheet metal bending Unfolding
Sheet metal bending
Offset curves on Surface
Molding and silhouettes
Lecture 7 Solid Modeling Data storage structures Vertex# Location Edge# Vertices Polygon# Edges V1 0,5,0 E1 V1,V2 P1 E1,E3,E2 V2 4,15,0 E2 V1,V4 P2 E3,E4,E5 V3 4,10,0 E3 V2,V4 V4 8,0,0 E4 V2,V3 E5 V3,V4 E1 E3 E2 E4 E5 V3 V1 V4 V2 P1 P2 V3 V1 V4 V2 P1 P2 Vertex# Location Polygon# Vertices V1 0,5,0 P1 V1,V2,V4 V2 4,15,0 P2 V2,V3,V4 V3 4,10,0 V4 8,0,0
Lecture 5 Solid Modeling Data storage structure tree ???? Feature Material = 1040 Volume BOX Boundary grind face1 face2 face6 Element line1 line2 line4 ??? Length tol. = 0.002
Solid modeling approaches Boundary Representation (B-rep) Constructive Solid Geometry (CSG) Sweep
Solid modeling approaches Hybrid (Feature based modellers) Analitical Solid Modeling (ASM)
Solid Modeling B-rep modeling data structure Octree solid representation
Manifold and non-manifold modeling
Constructive Solid Geometry (CSG) Based on simple geometric primitives cube, parallelepiped, prism, pyramid, cone, sphere, torus, cylinder, solid by points etc. Primitives are positioned and combined using boolean operations union (addition) difference (subtraction) Intersection Represented as a boolean tree
CSG Primitives
Half Spaces used in CSG modeling Surface descriptions
CSG modeling by Half Spaces
CSG boolean tree Examples A-B (A-B) È C union (addition) difference (subtraction) A B
Boundary Representation (B-Rep) Solids represented by faces, edges and vertices Topological rules must be satisfied to ensure valid objects faces bounded by loop of edges each edge shared by exactly two faces each edge has a vertex at each end at least 3 edges meet at each vertex
Boundary Representation (B-Rep) Euler’s rule applies: V – E + F = 2 where V = number of vertices, E = number of edges, F = number of faces. Euler-Poincare topological equation for solid with hole: V - E + F - (L - F) -2 (S - G) = 0 where L = number of edge loops, S = number of shells, G = genus of solid (holes). Surface must be closed
Boundary Representation (B-Rep) Euler’s rule V-E+F=2 Euler-Poincare rule V-E+F-(L-F)-2(S-G)=0
Solid B-Rep Example Vertices Edges Faces
Solid B-Rep Example Topology Same Geometry, Different Topology Different Geometry, Same Topology L2 L1 L3 C1 P1 R
Winged Edge Data Structure Topology and geometry F1 F2 E predecessor 2 successor 2 successor 1 predecessor 1 V2 V1 Vertex Topology Object Genus Face Loop Edge Geometry Underlying Surface equation Curve equation Point coordinates Body
CSG vs. B-Rep CSG Simple representation Limited to simple objects Stored as binary tree Difficult to calculate Rarely used anymore B-Rep Flexible and powerful representation Stored explicitly Can be generated from CSG representation Used in current CAD systems
B-Rep of cylinder and circle Boundary Model of Cylinder and Sphere Limb E1 F1 V1 (silhouette edge) E3 F3 F2 V2 E2 V F Limb
References Curves and Surfaces for Computer Aided Geometric Design: A Practical Guide, Fourth Edition, Gerald Farin, September 1996 Geometric Modeling, Second Edition, Michael E. Mortenson, John Wiley & Sons, January 1997 The NURBS Book, Second Edition, Les A. Piegl and W. Tiller, Springer Verlay, January 1997 CAD/CAM Theory and Practice , Ibrahim Zeid,, McGraw Hill , 1991 Solid Modelling with DESIGNBASE, Hiroaki Chiyokura, Addison-Wesley Publishing Company, 1988. Mathematical Elements for Computer Graphics, Rogers, D.F., Adams, J.A., McGraw Hill, 1990.