Under Graduate Course on Computer Aided Design & Manufacturing ( ME 502 ) Geometric Modeling Shibendu Shekhar Roy Robotics & A.I Lab. (RAIL) Department of Mechanical Engineering 1 Geometric Modeling Concept CAD Computer Graphics Algorithm Design & Analysis Theories/ Tools …To Automate the Design Process 2 1 Geometric Modeling Geometric modeling plays a crucial role in the overall application of CAD-CAM-CAE system Requirements of Geometric Modeling Information entered through geometric modeling is utilized in number of downstream applications like: Design Analysis ¾ Evaluation of centroid, area (cross-sectional & surface) & volume ¾ Estimate the mass & inertia properties ¾ Interference checking in assemblies ¾ Analysis of tolerance build-up in assemblies ¾ Kinematic/ Dynamic analysis & simulation ¾ Finite element analysis for stress, vibration, thermal & optimization Drafting ¾ Automatic 2D view generation ¾ Automatic planar cross-sectioning ¾ Automatic dimensioning 3 Geometric Modeling Manufacturing ¾ Part classification & Process planning ¾ NC tool path generation & verification ¾ Manufacturing process simulation ¾ Robot program generation Production & Industrial Engineering ¾ Preparation of Bill of Material (BOM) ¾ Material requirement planning ¾ Manufacturing resource requirement ¾ Scheduling ¾ Marketing Computer-Aided Inspection & Quality control etc….. 4 2 Geometric Modeling Hence, It is important that the geometric model generated should be as clear & comprehensive as possible so that the other modules of CAD-CAM-CAE system are able to use this information in the most optimal way. Two Dimensional (2-D) Geometric model Wireframe Modeling Three Dimensional (3-D) Surface Modeling Solid Modeling 5 Geometric Model Two Dimensional (2-D) ¾ Utility of 2-D model lies in many of the low end drafting packages which is required for preparing manufacturing drawings ¾ Their utility is limited because of their inherent difficulty in representing complex objects. Three Dimensional (3-D) ¾ The 3-D geometric modeling has the ability to provide all the information required for CAD-CAM-CAE applications Basic Requirement ¾ A 3-D geometric model should be an unambiguous representation of an object. ¾ A 3-D model should be complete to all engineering function from documentation (drafting & shading) to engineering analysis to manufacturing. 6 3 Wireframe Modeling ¾ In this method the complete object is represented by number of lines, points, arcs & curves and their connectivity relationships Advantages 9 The construction of a wireframe model is simple 9 It does not require much computer time & memory. 9 It can be used for simple NC tool path generation Disadvantages ¾ It can not be used for calculation of mass, inertia properties ¾ The interpretation of wireframe models having many edges is very difficult 7 Surface Modeling ¾ The surface model is constructed essentially from surfaces such a s planes, rotated curved surfaces & even very complex synthetic surfaces. ¾ Surface creation on existing CAD system usually requires wireframe entities as a start ¾ Surface & wireframe form the core of all existing CAD system Advantages 9 Surface model of an object is a relatively more complete & less ambiguous representation than its wireframe model 9 This method is very much useful for specific non-analytical surfaces ( free-form surface/ sculptured surfaces) such as those used for modeling automobile & airplane bodies & turbine blades etc. 9 From an application point of view, surface models can be utilized in Finite Element Modeling, NC tool path generation, sectioning & interference detections. Disadvantages ¾ The calculation of mass & inertia properties would be difficult 8 4 Solid Modeling ¾ Solid model of an object is a more complete representation than surface model, as all the information required for engineering analysis & manufacturing can be obtained with this technique. Advantages 9 Solid modeling produces accurate design, 9 provides complete 3D definition 9 Improves the quality of design 9 Improves visualization 9 has potential for functional simulation of the system 9 Wireframe Modeling Point Lines Analytic Entities / Curves Arcs Circles Ellipse Conics Wireframe entities Parabolas Hyperbolas <Geometric Primitives> Cubic spline Synthetic Curves Bezier curves B-spline NURBS (Non-Uniform Rational B-spline) Analytic Curve - are described by analytic equations Synthetic Curve - are described by a set of data points (i.e. control points) 10 5 Analytic Curve ¾ are defined as those that can be described by analytic equations such as lines, circle, conics etc. ¾ provide very compact forms to represent shapes & simplify the computation of related properties such as areas & volume. ¾ Analytic curves are usually not sufficient to meet today’s geometric design requirements of complex mechanical parts like automobile bodies, aeroplane wings, propeller blades, bottles etc. That require synthetic curves & surfaces (free-form surfaces) Synthetic Curve ¾ are defined as those that can be described by a set of data points (i.e. control points) such as Splines, Bezier curve etc. ¾ Synthetic curves provide designers with greater flexibility & control of a curve shape by changing the positions of the one or more data points or control points. 11 Synthetic Curve The need for synthetic curves in design arises on two occasions: i) when a curve is represented by a collection of measured data points (in case of Reverse Engineering) [graphical visualization of experimental data] ii) when an existing curve must change to meet new design requirements. Synthetic Curve Construction Techniques : Interpolation technique Approximation technique Curve passes through the data points Curve do not passes through the data points Mathematically, synthetic curves represent a Curve-fitting problem to construct a smooth curve 12 6 Interpolation Technique Approximation Technique - Curve resulting from this technique pass through the given data points; curve itself is called Interpolant - Produce curves that do not pass through the given data points. Instead, these points are used to control the shape of the resulting curves - Ex. : Cubic Spline -Ex. : Bezier Curve P7 P1 P5 P3 P2 P9 P8 P6 P11 P1 P12 P0 P2 P4 P0 P2 P10 P0 P3 P1 P3 Most often, approximation techniques are preferred over interpolation techniques in freeform curve design due to the added flexibility & the additional intuitive feel provided by approximate technique. 13 Mathematical Representation of Curves Explicit form Non-parametric equation Curve can be described mathematically by Implicit form Parametric equation Non-parametric equation : Explicit form If the co-ordinates ‘y’ & ‘z’ of a point on the curve are expressed as two separate functions of the third coordinate ‘x’ <independent variable>. This curve representation is known as Non-parametric Explicit form. Non-parametric Explicit form of a general 3-D curve Y Position vector of a point ‘P’ on the curve = P = [x y z]T= [x f(x) g(x) ]T P (x,y,z) P Z X 14 7 Non-parametric equation : Implicit form If the co-ordinates ‘x’, ‘y’ & ‘z’ are related together by two functions, a non-parametric implicit form results Non-parametric Implicit form of a general 3-D curve f1 (x,y,z) = 0 f2 (x,y,z) = 0 Parametric representation of curves Y P (x,y,z) umax In parametric form, each point on a curve is expressed as a function of a parameter “u”. This parameter acts as a local co-ordinate for points on the curve. P’(u) umin P(u) Z Parametric form of a general 3-D curve X Position vector of a point ‘P’ on the curve = P(u) = [x(u) y(u) z(u) ]T Where, umin ≤ u ≤ umax The parametric curve is bounded by two parametric variable values umin and umax. 15 Parametric Representation of Curves Advantages : ¾In case of commonly used curves (such as circle, conics), these equations are polynomials rather than equations involving roots. Hence, the parametric form is not only more general but it is also well suited to computation in geometric modeling. ¾Parametric geometry can be easily expressed in terms of vectors & matrices which enables the use of simple computation techniques to solve complex analytic geometry problem. ¾To check whether a given point lies on the curve or not, reduces to finding the corresponding ‘u’ values & checking whether that value lies in the stated ‘u’ range. 16 8 ¾Blending is used to construct composite curve. Blending of two curves implies the joining of two curves subjected to the satisfaction of continuity condition. ¾Various Continuity requirements can be specified at data points to impose various degrees of smoothness of the resulting curve. ¾The order of continuity becomes important when a complex curve is modeled by several curve segments pieced together end-to-end. Order of Continuity 17 Order of Continuity Zero-order Continuity First-order Continuity Second-order Continuity (C0 - continuity) (C1 - continuity) (C2 - continuity) Slope Continuous curve Curvature Continuous curve Ex.: Cubic Spline Ex.: B-Spline Position Continuous curve C1 – Continuous is “Smoother” than C0 – Continuous at the joining point C2 – Continuous is “Smoother” than C1 – Continuous at the joining point 18 9 Synthetic Curves Cubic Splines ¾Splines are used to interpolate to given data i.e. based on Interpolation technique. ¾A spline is a piecewise parametric representation of the geometry of a curve with a specified order of continuity. ¾Cubic splines use a parametric equations of 3rd degree with the first order continuity maintained at the intersection point of the curve. ¾Name from the traditional drafting tool called “Splines” or “French Curves” P0.8 P1 P.0.4 P0 19 Cubic Splines ¾ Cubic splines use cubic polynomial. The parametric equation of a cubic spline segment is given by Vector form Matrix form 3 G P(u) = ∑ Ci u i i=0 G P(u) = C0 + C1u + C2 u 2 + C3u 3 G P(u) = U T C Where, ⎡1⎤ ⎢u⎥ U = ⎢ 2⎥ ⎢u ⎥ ⎢u3 ⎥ ⎣ ⎦ u= parameter 0 ≤ u ≤ 1 Ci= Polynomial Coefficients ⎡ C0 ⎤ ⎢C ⎥ C = ⎢ 1⎥ ⎢C 2 ⎥ ⎢C ⎥ ⎣ 3⎦ C= Coefficients Vector ¾ Cubic polynomial has four coefficients & thus requires four conditions to evaluate . Cubic Spline Hermite Cubic Spline - Uses four data points P0.8 P1 - Uses two data points at its ends & two tangent vectors at these points P.0.4 P0 20 10 Bezier Curves ¾ Based on approximation techniques. ¾ Developed by P. Bezier, Designer of French car firm Regie Renault (1962). ¾ Used in his Software system (UNISURF) to define the outer panels of several Renault cars . ¾ Bezier curve uses the vertices of Bezier Characteristic polygon (or control polygon) as control points for approximating the generated curve. The curve will pass through the first & last point with all other points acting as control points. The curve is also always tangent to the first & last polygon segment. Control Points Control Polygon 21 Bezier Curves ¾The degree of Bezier curve is related to the number of data points; (n+1) points define an nth degree Bezier curve. ¾ If no. of data points is 4 [n+1=4], Then n=3 i.e degree of curve =3 (cubic) Control Points Control Polygon Cubic Bezier Curve ¾ This is widely used for the design of aesthetic surfaces. The flexibility of the curve becomes more with more control points. 22 11 Bezier Curves Control Points Control Polygon Mathematically, for (n+1) control points, the Bezier curve is defined by polynomial of degree n: P(u) is a point on the curve, Pi is a control point Bi,n(u) are the Berntein polynomials 23 Bezier Curves C(n,i) is the binomial coefficient 24 12 Bezier Curves 25 Major difference between the Bezier Curve & Cubic Spline Curve i. The degree of Bezier curve is variable & is related to the number of data points; (n+1) points define an nth degree curve which permits higher-order continuity. This is not the case for cubic splines where the degree is always 3 <cubic> for a spline segment. ii. The shape of Bezier curve is controlled by its data points only. First derivatives are not used in the curve development as in the case of Hermite cubic spline. iii. The Bezier curve is smoother than the cubic spline because it has higher order derivative. ¾ Bezier curve is considered as a single curve controlled by all the control points. As a result, with an increase in the number of control points, the degree of the polynomial representing the curve increases & this provides for global modification effect rather than local. ¾ To reduce this complexity, the curve is broken down into more segments with better control excised with individual segments, while maintaining a simple continuity between the segments. 26 13 B-Spline Curves ¾ Single piecewise parametric polynomial curve through any number of control points with the degree of polynomial selected by Designer. ¾ It provides the ability to add control points without increasing the degree of the curve. ¾ B-spline exhibit a local control of the curve shape i.e. whenever a single vertex is moved, only those vertices around that will be affected while rest remains the same. Interpolate a given set of data points Useful in displaying design & engineering analysis results such as Stress/displacement distribution Approximate a given set of data points Useful for modeling free-form surfaces B-Spline Curves ¾ In contrast to Bezier curve, the theory of B-spline curve separates the degree of the resulting curve from the no. of the given control points. ¾ Four control points can always produce a cubic Bezier curve but four control points can produce linear, quadratic or cubic B-spline curve. 27 B-Spline Curves Mathematically, B-spline curve defined by (n+1) control points Piis given by Where ‘k’ controls the degree (k-1) of the resulting polynomial & also continuity of the curve. 28 14 B-Spline Curves Local control of B-spline curve ¾ It provides the ability to add control points without increasing the degree of the curve. ¾ B-spline exhibit a local control of the curve shape i.e. whenever a single vertex is moved, only those vertices around that will be affected while rest remains the same. 29 NURBS Non-Uniform Rational B- Spline ¾ are generalization of the curve & surface theories. ¾ are almost exclusively used by modern CAD-CAM-CAE systems to provide a unified approach to formulate & represent curves & surfaces. ¾ provide a convenient design tool to create smooth curves & surfaces interactively. 9 Rational Curve: is defined by algebraic ratio of two polynomials while a non-rational curve is defined by one polynomial. n Rational form of Bezier Curves G P(u) = ∑Pw B i =0 n i i i,n (u) ∑ w i Bi,n (u) ; 0≤u≤1 i=0 where wi is the weighting factor for each of the vertex. 30 15 NURBS Advantages 9 NURBS are considered a unified representation that can be define both synthetic (like Bezier, B-spline etc.) & analytic (i.e. circle, conics etc.) curves & surfaces. Any curve or surface can be formulated using NURBS. 9 It can represent all curves, surfaces, & solid entities, allowing unification & conversion from one CAD system to another via exchange standards (like IGES,, STEP etc.). Their related algorithm are stable & accurate. 9 This unified representation also have the advantage of reducing the database complexity & the number of procedures required in CAD system for display & manipulation of geometric entities. Disadvantages ¾ Simple curves (like arcs, circles, conics) require more data to define as NURBS than traditional way. 31 ¾ The effective use of analytic & synthetic curves in a design environment depends mainly on their manipulation. Displaying Blending Segmentation Curve Manipulations Trimming Intersection Transformation Translation Rotation Scaling Mirror/ Reflection Evaluating points on curves 32 16 Curve Manipulations Displaying ¾ provides the Designer with a means of visualizing geometric models. Blending ¾ is used to construct composite curves from various types of curve segments. Two curve segment should be continuous at the joint. Segmentation ¾ replacing one existing curve by one or more curve segments of the same curve type such that the shape of the composite curve is identical to that of the original curve. Trimming ¾ is a very useful function which can truncate or extend a curve Intersection ¾ the intersection point of two curve in space requires the solution of the parametric equations of curves. Translation Transformation Rotation Scaling Mirror/ Reflection Evaluating points on curves ¾ Curve parametric eqn. is used to evaluate points on it. 33 Surface Modeling Plane surface Analytic Surface Entities Ruled surface/ Lofted surface Surface of revolution Tabulated cylindrical surface Surface entities Bi-cubic Hermite spline surface Synthetic Surface Entities B-Spline surface Bezier surface or patch Coons patch Curve segment : is the fundamental building block for curve entities Surface patch : is the fundamental building block for surfaces 34 17 Plane Surface ¾ is the simplest surface which requires three non-coincident points to define a plane. ¾ The plane surface can be used to generate cross-sectional view by intersecting a surface model with it. Ruled Surface ¾ is a surface constructed by transitioning between two or more curves by using linear blending between each section of the surface ¾ It interpolates linearly between two boundary curves that define the surface. Lofted Surface ¾ is a surface constructed by transitioning between two or more curves by a smooth i.e. higher order blending between each section of the surface. ¾ Used for modeling engine manifolds, turbine blades etc. 35 Surface of Revolution ¾ is an axi-symmetric surface that can model axisymmetric objects. ¾ is generated by a rotating a planar wireframe entity in space about the axis of symmetry a certain angle. Tabulated Cylindrical Surface ¾ is a surface generated by translating a planar curve a certain distance along a specified direction (axis of cylinder). ¾ Plane of the curve is perpendicular to the axis of the cylinder. ¾ is used to generate surfaces that have identical curved cross-sections. 36 18 Bi-cubic Hermite Spline Surface ¾ It connects four corner data points & utilizes a bi-cubic equation. Bezier Surface ¾ is a synthetic surface that approximates given input data i.e. it doesnot pass through all given data points. ¾ Allows only global control of the surface. B-spline Surface ¾ is a synthetic surface that can either approximate or interpolate given input data. ¾ Permits local control of the surface. Coons patches / surface ¾ Coons patch or surface is obtained by blending four boundary curves. ¾ is used to create surfaces using curves that form closed boundaries. ¾ the single patch can be extended in both the directions by adding further patches. 37 Displaying Blending Segmentation Trimming Surface Manipulations Intersection Transformation Projection Evaluating points & curves on surfaces 38 19 Solid Modeling ¾ Solid model are known to be informationally more complete, valid & unambiguous representation of objects than its wireframe or surface model. ¾ The completeness & unambiguity of a solid model are attributed to the fact that CAD database stores both its geometry & topology. ¾ Solid models are complete & unambiguous but they are not unique because same object may be constructed in various ways. ¾ Solid modeling has been acknowledged as the technological solution to automating & integrating design & manufacturing functions like… Design / Engineering Analysis Drafting CAPP, CNC tool path generation MRP Computer-Aided Inspection & Quality control 39 ¾ A solid model of an object consists of both the geometrical & topological data of the object. Geometry - Geometry of an object defines the actual dimensions of its entities. Topology - Topology of an object defines the connectivity & associativity of the entities. - it determines the relational information between entities. From user point of view, Geometry is visible. Topology is considered to be non-graphical relational information that is stored in solid model databases & are not visible to users. 40 20 Geometry The geometry that defines the object is the - the length of lines L1, L2, L3 - the angle between the lines - radius ‘R’ & the centre ‘P’ of semi-circle Topology The topology of the object can be stated as - L1 shares a vertex (point) with L2 & C1 - L2 shares a vertex with L1 & L3 - L3 shares a vertex with L2 & C1 - L1 & L3 donot overlap - ‘P’ lies outside the object L1 C1 L2 R P L1 R L2 P C1 L3 L1 L3 R R L2 L1 L2 P P C1 C1 L3 L3 Same Topology but Different Geometry 41 Same Geometry but Different Topology Solid Modeling Modern CAD systems offer two approaches to creating solid models : Primitive Approach - allows designers to use pre-defined shapes (primitives) as building blocks to model solid object. - Boolean operation are used to combine the primitives to create complex objects. - is limited by the restricted shapes of primitives Feature Approach - Features are more flexible as they allow the construction of more complex solid than what the primitive offer. Feature is defined as a geometric shape (i.e. feature profile or 2-D sketch) and feature operation to build parts. Feature Feature Profile (Sketch) + Feature Operation ¾ The entities required for Feature profile (Sketch) are wireframe & surface entities ¾ Feature Operation is an activity that converts the Sketch (2-D) into 3-D shape 42 21 Constraints Geometric Constraints Dimension Constraints Fix Coincidence Concentricity Tangency Parallelism Perpendicular Horizontal Vertical Mid point Equidistant point ¾ Geometric constraints is defined as a geometric condition that relates two or more sketch entities. 43 Constraint-based Feature Modeling Select a Sketch Plane Sketching the feature profile (2D profile) Apply Geometric & Dimensional Constraints Apply feature operations Create Base Feature Combine feature to build part - is considered the best tool to create solids because of its ability to edit & change the shape of the solid in the future by using its relations & constraints. It has flexibility to create complex shape. 44 22 Common Feature Operations & Features Extrude Protruded Feature Revolve Sweep Loft Feature Operations Rib Pocket Hole Slot Shell 45 Common Feature Operations & Features Fillet Chamfer Rectangular Pattern Pattern Feature Operations Circular Pattern Translation Transformation Rotation Scaling Mirror Thread 46 23 Common Features Extruded or Protruded feature ¾ Extrude command is used to create a solid object by extruding a given closed profile. ¾ It requires a closed profile (sketch of cross-section of solid object) & an extrusion vector (length & direction). ¾ The extrusion direction is always perpendicular to the sketch plane of the profile. Revolved feature ¾ Revolve command is used to create an axi-symmetric objects by revolving the selected geometry about an axis. ¾ It requires a profile (sketch of cross-section of solid object) & a revolution vector (axis & angle of revolution). ¾ The axis of revolution is always in the sketch plane of the profile. 47 Common Features Sweep feature ¾ is a generalization of extrusion. ¾ Creates a feature by moving a sketch (closed or open) along a linear or non-linear path, which is not necessarily perpendicular to the sketch plane. Loft feature ¾ Use to blend multiple cross-section (two or more) along the linear or non-linear guide curve to create a solid. Hole feature ¾ is equivalent to subtracting a cylinder from a solid. Simple and Taper hole Counter-bored hole Type of Hole feature Counter-sunk hole Threaded hole 48 24 Common Features Slot feature ¾ Removes material from solid. Rectangular slot Type of Slot feature T- slot Dovetail slot Shell feature ¾ Shell operation is used to create hollow or thin-walled solids by removing material out. ¾ The input to a shell operation is the faces to be removed & a wall thickness. 49 Common Features Rib feature ¾ is a special type of extruded feature. ¾ Creates an extension of geometric element by creating a feature connecting the two faces of the part. ¾ The input to create a rib is a contour & a thickness Pattern feature Rectangular Pattern Circular Pattern ¾ Used to create multiple copy of given feature in rectangular (linear) array. ¾ Used to create multiple copy of given feature in circular array. 50 25 Common Features Fillet ¾ are used to smoothen (round) the sharp edges of solid. ¾ input to create a constant radius fillet feature is to select the edges to be filleted & fillet radius. Chamfer ¾ use to remove sharp edges (or corners) from parts ¾ input to create a chamfer is angle-distance, distancedistance. 51 Boundary representation (B-rep) Constructive Solid Geometry (CSG) Sweeping Half spaces Solid Representation Schemes Analytic Solid Modeling (ASM) Cell decomposition Spatial enumeration Octree encoding Primitive Instancing 52 26 Boundary representation (B-rep) ¾ B-rep is based on the topological notion that an object is bounded by a set of faces. ¾ A face is a closed, orientable & bounded (by edges) surface. Each face is bounded by edges & each edge (bounded curve) is bounded by vertices. ¾ B-rep model of an object consists of faces, edges, vertices. Vertices (v) Edge (E) Face (F) - The database of a boundary model contains both its topology & its geometry. Topology & Geometry are interrelated & cannot be separated entirely from each other 53 B - rep Advantages 9 B-rep is very appropriate to construct solid models of unusual or complex shapes ( like turbine blades, auto body etc.) that are difficult to build using primitives. 9 It is relatively simple to convert a B-rep model into a wireframe model because the model’s boundary definition is similar to the wireframe definition. Disadvantages ¾ It requires large amounts of storage because it stores the explicit definition of model boundaries i.e. faces, edges & vertices which tend to grow fairly fast for complex model. 54 27 Constructive Solid Geometry (CSG) ¾ CSG model is based on the topological notion that a physical object can be divided into set of primitives (basic elements & shapes) that can be combined in a certain order following a set of rules (Boolean operation) to form the object. Primitives are considered as building block Primitives are simple, basic shapes which can be combined by a mathematical set of Boolean operations to create the complex solid object. Primitives Block Cylinder Cone Sphere Wedge 55 Boolean Operations Union (U) Intersection (∩) Difference (-) Used to combine or add two primitives/ objects Intersecting two primitives give a shape equal to their common value Used to subtract one primitive from other & results in shape equal to the difference in their volume 56 28 CSG Advantages 9 It is easy to construct out of primitives & Boolean operation. 9 It is concise & requires minimum storage. Disadvantages ¾ Major disadvantage of CSG is in its inability to represent sculptured surfaces i.e. non-analytical (synthetic surface) cannot be modeled using CSG scheme. - Modern CAD systems provide both approaches to increase their modeling domain 57 Solid Model-based Down-stream Application Solid Model-based Assembly Design Solid Model-based Drafting Solid Model-based Mechanism Design Finite Element Modeling from Solid Models CNC machining based on Solid Modeling … 58 29