CIM 23.6 (1)

Embed Size (px)

DESCRIPTION

CIM

Citation preview

CAD

CADCAD is often defined in a variety of ways and includes a large range of activities. Very broadly it can be said to be the integration of computer science (or software) techniques in engineering design. It encompasses the following:Use of computers (hardware & software) for designing productsNumerical method, optimizations etc.2D/3D drafting3D modeling for visualizationModeling curves, surfaces, solids, mechanism, assemblies, etc.

2D TransformationsWorld CoordinatesTranslateRotateScaleViewport TransformsPutting it all togetherTransformationsRigid Body Transformations - transformations that do not change the object. TranslateIf you translate a rectangle, it is still a rectangleScaleIf you scale a rectangle, it is still a rectangleRotateIf you rotate a rectangle, it is still a rectangleVerticesWe have always represented vertices as (x,y)An alternate method is:

Example:

Matrix * Vector

2D geometric transformation

TRANSLATION A translation is applied to an object by repositioning it along a straight line path from one coordinate location to another. We translate a two-dimensional point by adding translation distances,xand y, to the original coordinate position(x,y)to move the point to a new position(x',y').The translation distance (x,y) is called translation vectors.

TranslationTranslation - repositioning an object along a straight-line path (the translation distances) from one coordinate location to another.(x,y)(x,y)(tx,ty)

TRANSLATION

TRANSLATION

Translation of an object

Fig illustrate a translation of triangle about orgin.When the object is to be moved, all points of it are to be translated.The translation of key points and connection of these points by other geometric entities like lines,arcs.etc.

Fig illustrates original position and new positions of the triangle ABC after translation

TranslationGiven:

We want:

Matrix form:

SCALING Scaling is a kind of transformation in which the size of an object is changed. Remember the change is size does no mean any change in shape. This kind of transformation can be carried out for polygons by multiplying each coordinate of the polygon by the scaling factor.SxandSywhich in turn produces new coordinate of(x,y)as(x',y'). The equation would look like

Or Srepresents the scaling matrix.

SCALINGIf the values of scaling factorare greater than 1 then the object is enlarged and if it is less that 1 it reduces the size of the object. Keeping value as 1 does not changes the object.Uniform Scaling:To achieve uniform scaling the values of scaling factor must be kept equal.Differential Scaling:Unequal or Differential scaling is produce incases when values for scaling factor are not equal.As per usual phenomenon of scaling an object moves closer to origin when the values of scaling factor are less than 1. To prevent object from moving or changing its position while is scaling we can use a point that is would be fixed to its position while scaling which is commonly referred asfixed point(xfyf).

SCALING

SCALING

Scaling of a Point: Mathematically after scaling, the new coordinates of point P(x , y) are given below:

ROTATION

A two-dimensional rotation is applied to an object by repositioning it along a circular path in thex-yplane. When we generate a rotation we get a rotation angle()and the position about which the object is rotated(xr, yr)this is known asrotation pointorpivot point. The transformation can also be described as a rotation aboutrotation axisthat is perpendicular tox-y plane and passes through the pivot point. Positive values for the rotation angle define counter-clockwise rotations about the pivot point and the negative values rotate objects in the clockwise direction.

2D Rotation2D Rotation: Rotate the points a specified rotation angle about the rotation axis.Axis is perpendicular to xy plane; specify only rotation point (pivot point ,

212D Rotation

Simplify: rotate around origin:222D RotationThe matrix expression could be modified to include pivot coordinates by matrix addition of a column vector whose elements contain the additive (translational) term.

Rotation of a point about an arbitrary pivot position:232D RotationRigid-body translation: Rotates objects without deformation (every point of the object is rotated through the same angle.

YX 0 1 1 2 2 3 4 5 6 7 8 9 10 3 4 5 6

24Fig illustrates a rotation of a Polygon by 45 in counterclockwise

Rotation of a point about the origin: Consider the rotation of a point from its initial position P(x,y) by an angle about the origin, as shown in fig. the counterclockwise rotation is considered as positive and clockwise rotation as negative.

x= rcos( + ) = rcos cos rsin sin y = rsin( + ) = rcos sin+ rsin cos Substituting x= rcos and y= rsin into equation gives, x = xcos - y sin y = xsin + ycos In matrix form,

P = R . P

RzCOS -SINSIN COSCOS SIN-SIN COSRyCOS -SINSIN COSRyRotation matrix for rotation about z axis is given by

Rotation matrix for rotation about y axis is given by

Rotation matrix for rotation about x axis is given by

Reflection

Reflection

Homogeneous RepresentationScaling and Rotation matrices are in the form of matrix multiplication and the translation takes the form of vector addition.To concatenate the transformations, all the transformation matrices should be multiplied.If a point has Cartesian coordinates (x,y,z), the homogenous coordinates are (x,y,z,1) where h is the scale factor. The relation between Cartesian and homogeneous coordinates: x = x/h, y = y/h, z = z/h For the geometric transformations, the scale factor h is taken as unity to avoid unnecessary division.

If a point has Cartesian coordinates (x,y), the homogeneous coordinates are (x,y,h)

Homogeneous RepresentationThe Homogeneous Representation of basic transformation is given below:

Three Dimensional Modeling TransformationsMethods for object modeling transformation in three dimensions are extended from two dimensional methods by including consideration for the z coordinate.33Three Dimensional Modeling TransformationsGeneralize from 2D by including z coordinate

Straightforward for translation and scale, rotation more difficult

Homogeneous coordinates: 4 components

Transformation matrices: 44 elements34Three Dimensional Geometric TransformationTo manipulate, to view and/or to modify the 3D objects, it require the use of 3D geometric and coordinate transformation.The 2D transformations by adding the z-axis parameter i.e., homogeneous coordinate system with 4 x 4 matrix.The system of x-,y- and z-axis i.e., Cartesian coordinate system is used to represent an object in 3D.Three Dimensional Geometric TransformationThe generalized 4 x 4 transformation matrix for 3D homogeneous coordinates with partitions into separate sections below.

Three Dimensional Geometric TransformationThe 3 x 3 sub matrix produces a linear transformation in the for of scaling, rotation, reflection , and shearing.The 3x1 right sub matrix produces translation (j= x, k=y, l=z)The 1 x 3 sub matrix produces perspective transformation.The 1 x 1 sub matrix produces overall uniform scaling.3D Translation

Homogeneous coordinates is given byTranslation Matrix is given by3D Translation of an object3D ScalingIf the scaling factor parameter are Sx,Sy,Sz along x-,y-,z-directions respy,then the new coordinates of a point on the scaled object is given byThe Scaling transformation matrix in homogeneous coordinates is given by

3D ScalingThe Scaling Matrix is given byThe 3D Scaling of an object

3D PointWe will consider points as column vectors. Thus, a typical point with coordinates (x, y, z) is represented as:

413D Point Homogenous CoordinateA 3D point P is represented in homogeneous coordinates by a 4-dim. Vect:

423D Point Homogenous CoordinateWe don't lose anything

The main advantage: it is easier to compose translation and rotation

Everything is matrix multiplication

433D Coordinate SystemsRight Hand coordinate system:

Left Hand coordinate system:443D TransformationIn homogeneous coordinates, 3D transformations are represented by 44 matrixes:

45

HOMOGENEOUS COORDINATES

Basic transformations can be expressed in matrix form. But many graphic application involve sequences of geometric transformations. Hence we need a general form of matrix to represent such transformations. This can be expressed as:

Where PandP' - represent the row vectors.T1 - is a 2 by 2 array containing multiplicative factors.T2 - is a 2 element row matrix containing translation terms.multiplicative and translational terms for 2D geometric transformations into a single matrix representation by expanding the 2 by 2 matrix representations to 3 by 3 matrices. This allows to express all transformation equations as matrix multiplications, providing that also expand the matrix representations for coordinate positions. To express any 2D transformations as a matrix multiplication, we represent each Cartesian coordinate position(x,y)with thehomogeneous coordinatetriple(xh,yh,h),such that

general homogeneous coordinate representation can also be written as(h.x, h.y, h).For 2D geometric transformations, we can choose the homogeneous parameter h to any non-zero value. Thus, there is an infinite number of equivalent homogeneous representations for each coordinate point(x,y). A convenient choice is simply toh=1. Each 2D position is then represented with homogeneous coordinates(x,y,1). Other values for parameter h are needed, for eg, in matrix formulations of 3D viewing transformations.

TranslationRotationtransformationScalingtransformationtransformation3D Translation493D TranslationP is translated to P' by:

503D TranslationAn object is translated in 3D dimensional by transforming each of the defining points of the objects .

513D TranslationAn Object represented as a set of polygon surfaces, is translated by translate each vertex of each surface and redraw the polygon facets in the new position.

Inverse Translation:523D Rotation533D RotationIn general, rotations are specified by a rotation axis and an angle. In two-dimensions there is only one choice of a rotation axis that leaves points in the plane.

543D RotationThe easiest rotation axes are those that parallel to the coordinate axis.

Positive rotation angles produce counterclockwise rotations about a coordinate axix, if we are looking along the positive half of the axis toward the coordinate origin.

55GEOMETRIC MODELINGThe geometric modeling is the computer compatible mathematical description ofthe geometry of the object.The mathematical description allows the image of the object to be displayed andmanipulated on the computer screen and also it can be stored in the memory andretrieved back and displayed on the computer screen whenever required. The geometric modeling can be classified into1. Wire frame modeling.2. Surface modeling3. Solid modeling

Wireframe ModelsModeling of objects & pictures mean description of the objects & pictures to the computer so as to produce a visual display that simulates the real thing.One way to do is to use set of primitives or geometric form that are simple enough to be easily implemented on the computer & flexible to represent model. Simple geometric form are;Points and Lines: We specify a line by giving its coordinates in 3-D such as endpoints of a line P1(x1,y1,z1) & P2.Polylines: is a chain of connected line segments. It is specified by giving the vertices P0,P1.Pn defining the line segment.Polygons: Closed polylines

(iv) Polyhedron : is a closed polygonal net (i.e one which encloses a definite volume) in which each polygonal is planar.The polygons are called the faces of the polyhedron. Wireframe Model : consists of edges, vertices & polygons.Here vertices are connected by edges & polygons are sequences of vertices or edges. The edges may be curved or straight line segment. Wireframe Model is called a polygonal net or polygonal mesh.

Sample rendering of a wireframe cube, icosahedrons, and approximate sphere

A wireframe model consist of points and curves only, and looks as if its made up with a bunch of wires. This is the simplest CAD model of an object. Advantages of this type of model include ease of creation and low level hardware and software requirements. Additionally, the data storage requirement is low. The main disadvantage of a wireframe model is that it can be very confusing to visualize. For example, a blind hole in a box may look like a solid cylinder, as shown in the figure. In spite of its ambiguity, a wireframe model is still the most preferred form, because it can be created quickly and easily to verify a concept of an object. The wireframe model creation is somewhat similar to drawing a sketch by hand to communicate or conceptualize an object. As stated earlier, a wireframe model is created using points and curves only. WIRE FRAME MODELING

Simple model of 2D projection(a). Without hidden line removal (b). With hidden line removalSimple 3D wire frame model is shown in figWIRE FRAME MODELINGWire frame modeling is the simplest method of modeling the object.Wire frame models can be considered as networks of inter connected lines to represent the edges of the physical objects being modeled. A typical wire frame may consist of points, lines, arcs, circles, conies and curves. There are two types of wire frame modeling 21/2 and 3D modeling. Projecting the 2D plane profile along its normal or rotating the 2D plane profileabout an axes is known as 21/2 D projection. A simplest 2 /2 D model is shown in figAdvantages 1. Wire frame models are simple and easy to create, with little computer time and memory. 2. Wire frame model form the basis for surface model. 3. CPU time required to retrieve, edit or update a wire frame model is usually small compared with surface or solid models. Wire frame modeling can be considered as extension of computer aided drafting. Wire frame models provide accurate information about the location of surface discontinuity on the part. It can be used as a basis for automatic generation of cutter paths to drive NC machine tool to manufacture component.Disadvantages

1. There is always some ambiguity in visualizing the 3D model. Fig Shows Interpretation of 3D wireframe model The wire frame model shown in fig (a) may be interpreted as a model shown in fig (b) or (c) i.e. 3D wire frame model can be interpreted in more number of ways.Disadvantages2. Without hidden line removal object become clumsy and difficult to understand the object.3. Calculation of section properties and mass properties are impossible.4. It has limited use in manufacturing and analysis.5. Presentation of circular holes and curved surfaces are poor.6. Interference checking will be difficult.SURFACE MODELINGThe ambiguities of wire frame modeling are overcome with surface models.The surface modeling takes the modeling of an object one step beyond wire frame model by providing information on surfaces connecting the object edges. i.e., A surface model can be built by defining the surface on the wire frame. This is analogous to stretching a thin sheet of material over a frame work. The surfaces generated by the surface modeling are classified into (a) Flat surface - most basic feature of surface model. (b) Sculptured surfaces - based on flat face mostly used in FE analysis. (c) Sculptured surfaces based on patches. (d) Analytical surfaces (very rarely used).

(e) Combination of the above types.

Simple and basic form of surface is flat surface. The most general and complex surface representations are generally known as sculptured surface. Sculptured surface means the surface produced from combining two families of curves that intersects one another in a cross-cross manner, creating network of inter connected patches.Sculptured surfaceCommon entities used in a surface modeling software s arePlane surface.Ruled (lofted) surface.Surface of revolution.Tabulated surface.Bezier surfaceB-spline surfacecoons patchFillet surface.Offset surface.SURFACE MODELINGPlane surface:

Ruled (lofted) surface:This is the simplest surface. It requires 3 non-coincident points on an infinite plane.

This is a linear surface. It interpolates linearly between two boundary curves as shown infig.SURFACE MODELINGSurface of revolution:Tabulated surface:

This is an axis symmetric surface that can model axisymmetric objects. It is generated by rotating a planer curve in a space about the axis of symmetry for certain angle of rotation.

This is a surface generated by translating a planner curve along a specified direction as shown in figSURFACE MODELINGOffset surface:B-spline surface:

Existing surfaces can be offset to create new ones identical in shape but havedifferent dimension. The new surface will be created at a faster rate. For example, to create a holding cylinder, first inner or outer cylinder can be created using a cylinder command. Based on this surface, other cylindrical surface can be created by using offset command is shown in fig

The B-spline surface is generated from the basis of B-spline curve. The simple form of the B spline is shown in figSOLID MODELINGSolid modeling is the most powerful 3D modeling technique.There are more number of methods available to generate solid models.Out of which two basic approaches are important from our subject point of view.They are (1) Constructive solid geometry (CSG). (2) Boundary representation (B-rep.)

Constructive solid geometry

A solid modeler has a library of set of basic element shapes known as primitives like, cuboid, cylinder, sphere, cone, wedge, torus etc as shown in fig 3.16).Fig 3.17 Types of Boolean operation In this approach, the physical objects are modeled by combining these primitives by a set of Boolean operations.The type of Boolean operations is used in CSG are Union (U), difference and intersection (n). These Boolean operations are explained in fig 3.17.Fig 3.17 Types of Boolean operation

Here, directed graph (Binary tree) scheme is used to store the model in the data structure. The general form of the tree-type data structure used in CSG approach is shown in fig 3.18.Fig 3.18 General tree type data structure Any node may have one parent node and two-child node. The root node (R) has no parent and leaf node (L) has no children. For example to create a model as shown in fig 3.19, four primitives two rectangular blocks and two cylinders are required. To create the final object following Boolean operation has to be carried out.

Advantages:

1. Since, the data to be stored are less, memory required will be less.2. Create fully valid geometrical solid model.3. Complex shapes may be developed relatively quicker with the available set of primitives.4. Less skill is enough.

Disadvantages:

1. More computational effort and time are required whenever the model is to be displayed in the screen.2. Getting fillet, chamfer and taperness in the model is very difficult.Boundary representation (B - rep.)

This approach is widely used in most of solid modelers. The solid model created by using B- rep technique may be stored in graph based on data structure system. This is illustrated with an simple example of tetrahedron shown in figFig shows Illustration of B-rep data structure of tetrahedronThe tetrahedron is composed of four vertices namely A, B, C and D. The co-ordinate of these vertices is stored in the database. The fig. (b) shows how the vertices are connected to form edges (a, b, c, d, e and f) and how these edges are connected together to form the face (ABC, BCD,ACD, ABD) which makes the complete solid of tetrahedron. These connectivities to form the solid are popularly known as topology.In B-rep modeler, in addition to store the topology of solid, topological consistency of the models is also carried out in order to create geometrically valid solid models. For topological consistency, certain rules have to be followed. They are (a) Faces should be bound by a simple loop of edges and should be not intersected by itself (b) Each edge should exactly adjoin two faces and each edge should have a vertex at each end. (c) At least three edges should meet at each vertex.

Elements of topologyFor bodies without holes should satisfy Euler s rule.Even if the topological consistency is achieved, in some cases like solidshaving concave faces will not give geometrically valid solid. The B-rep scheme is more widely used because In CSG the number of basic primitives available are limited. The performance of B-rep scheme is very much superior to that of CSG scheme for complex engineering models. Conversion of CSG to B-rep is possible, but conversion from B-rep to CSG is not possible. Combining the wire frame and surface model is possible only through B-rep solid representation.Advantages:1. Computational effort and time required to display the model are less compared with CSG.2. Combining wire frame and surface model are possible.3. Complex engineering objects can be modeled very easily compared with CSG.4. Since the topology and geometry are treated separately, incorporating new geometries in the existing model is easy.5. It is particularly suitable for modeling part having internal symmetry.Disadvantages:1. The data to be stored is more and hence it requires more memory.2. Some times geometrically valid solids are not possible.