Autocad Lab Manual
Autocad Lab Manual
AUTO CAD
LAB MANUAL
B. Tech IV Year - I Semester
NAME : ______________________________________
ROLL NO : ______________________________________
BRANCH : _______________________________________
DEPARTMENT OF
MECHANICAL ENGINEERING
Department of Mechanical 1
Auroras Technological and Research Institute Auto Cad Lab
LIST OF EXPERIMENTS
I. AUTOCAD
1. Create a 2D view of the given diagram using Auto CAD
2. Create a 2D view of the given diagram using Auto CAD
3. To create a 2D view of the given diagram using Auto CAD
4. To create a 2D view of the given diagram using Auto CAD
5. To create a 2D view of the given diagram using Auto CAD
6. To create a 2D view of the given diagram using Auto CAD
Department of Mechanical 2
Auroras Technological and Research Institute Auto Cad Lab
7. Draw the shear force and bending moment diagrams for cantilever beam using ansys tool
8. Draw the shear force and bending moment diagrams for cantilever beam using ansys tool
9. Draw the shear force and bending moment diagrams for cantilever beam using ansys tool
10. Solid modeling
11. Determine the max,min stresses induced in a given solid structure
12. Determine the max. value of temperature in the given fin
CNC TURNING
Department of Mechanical 3
Auroras Technological and Research Institute Auto Cad Lab
Auto CAD
Exercise 1
Procedure:
1. Type limits in command menu & set value to 297,290.
3. To set the paper size type zoom -> enter and type a -> enter in
Command bar.
7 .From the modify tool bar, use the array command to draw the 6holes with
10. Again draw the concentric of radius 100 from centre of circle
11. From the modify toolbar, use the offset command to draw the 12 & 23
distance circle.
12. Draw 2 circles. With radius 23 & 12 on the 100R circle where the 300
line co-inside.
13 . From modify toolbar, mirror these circle to represent the another side.
14 . And offset vertical line from centre of circle with a distance both side of
vertical line.
Department of Mechanical 4
Auroras Technological and Research Institute Auto Cad Lab
15 . From modify toolbar, use the fillet command to represent fillet of radius
Viva Questions
1. What is CAD?
2. What is the difference between Pan and Zoom?
3. What is the difference between line and spline?
4. What is the difference between chamfer and fillet?
5. By how many ways can you draw a circle?
Department of Mechanical 5
Auroras Technological and Research Institute Auto Cad Lab
Exercise 2
Aim: To create a 2D view of the given diagram using Auto CAD.
Procedure:
Department of Mechanical 6
Auroras Technological and Research Institute Auto Cad Lab
Viva Questions
1. What is the difference between line and Spline?
2. What is the difference between chamfer and fillet?
3. What are different ways to draw a circle?
4. What are the possible ways to draw an arc?
5. How to extend a line?
6. What is the procedure to enter into AutoCAD?
Department of Mechanical 7
Auroras Technological and Research Institute Auto Cad Lab
Exercise 3
Department of Mechanical 8
Auroras Technological and Research Institute Auto Cad Lab
Viva Questions
1. What are the possible ways to draw arc?
2. How to extend line?
3. What is the purpose of command trim?
4. How to convert 2D drawings to 3D drawings?
5. How to give dimension?
Department of Mechanical 9
Auroras Technological and Research Institute Auto Cad Lab
Exercise 4
Procedure:
1. Type limits in command menu & set value to 297,290.
3. To set the paper size type zoom -> enter and type a -> enter in
Command bar.
7. And use the array command from modify tool bar to represent the 8 holes
10. Use the array command from the modify tool bar to represent the 6 holes
with 8dia
11. Draw the 2 concentric circles of diameter 22 and 20 radius at the right side
13. And again draw the circles of diameter 16& 20R at left side of the vertical
15. Then trim the unwanted lines to get the required 2D drawing.
Department of Mechanical 10
Auroras Technological and Research Institute Auto Cad Lab
Viva questions
1. What is the purpose of command trim?
2. How to convert 2D drawings to 3D drawings?
3. What is the difference between Pan and Zoom?
4. What is difference between circle and ellipse?
5. What is the difference between rectangle and polygon?
Department of Mechanical 11
Auroras Technological and Research Institute Auto Cad Lab
Exercise 5
Aim: To create a 2D isometric view of the given diagram using Auto CAD.
Procedure:
1. Type limits in command menu & set value to 297,290.
2. Change the units to millimeters from inches and also precision to 0 by
clicking format -> units -> ok.
3. To set the paper size type zoom -> enter and type a -> enter in command bar.
4. Go to drafting settings and turn on isometric snap..
5. Use the F5 key to change between the views of isometric planes.
6. Start from the front view and draw the the line of length of line 104 using the
F8 key (O snap key) and continue with the 48 length line.
7. Change to top plane and draw the 72mm line.
8. Continue in the same fashion to complete the whole figure.
9. Give the dimensions from the dimension tool bar as in diagram.
Result: Hence the required 2D isometric diagram is created using Auto CAD.
Viva questions
1. What is the difference between metric unit and English unit?
2. What is the shortcut key for Ortho ON/OFF ?
3. What is the shortcut key for help?
4. What are the various ways to draw a measured line?
5. .What are object snap command.
Department of Mechanical 12
Auroras Technological and Research Institute Auto Cad Lab
Exercise 6
Aim: To create a 2D isometric view of the given diagram using Auto CAD
Procedure:
Department of Mechanical 13
Auroras Technological and Research Institute Auto Cad Lab
Result: Hence the required 2D isometric diagram is created using Auto CAD.
Viva questions
1. How do you select the isometric snap?
2. How to shift between different planes while using 0-snap?
3. How to give chamfer for a closed figure?
4. How to draw a circle in isometric diagram
5. How to dimension the diagram in isometric view.
Department of Mechanical 14
Auroras Technological and Research Institute Auto Cad Lab
Solid works
Exercise -1
Aim: Draw the basic sketch of the solid model shown in Figure A. The sketch is shown in Figure
B. You will not dimension the sketch. The solid model and the dimensions are given only for
your reference.
Department of Mechanical 15
Auroras Technological and Research Institute Auto Cad Lab
Procedure:
1. Start SolidWorks by choosing Start > Programs > SolidWorks 2006 > SolidWorks
2006.
2. The SolidWorks Resource Task Pane is displayed on the right of the SolidWorks
window.
5. The Part button is chosen by default. Choose the OK button from the New SolidWorks
Document dialog box as shown in Figure C.
6. Choose the Maximize button available on the upper right corner of the part document
window to maximize the document window.
7. Choose the Sketch button from the Standard toolbar. The Edit Sketch
PropertyManager is displayed and you are prompted to select a plane on which you
want to create the sketch.
8. Select the Front plane. The sketching environment is invoked and the plane is
Oriented normal to the view. You will notice that a red color origin is displayed in
the center of the screen, indicating the sketching environment. The default screen
Department of Mechanical 16
Auroras Technological and Research Institute Auto Cad Lab
9. Choose Tools > Options from the menu bar to invoke the System Options -
General dialog box.
10. Choose the Document Properties tab. The name of the dialog box is changed to
the Document Properties - Detailing dialog box.
11. Select the Units option from the area on the left to display the options related to linear
and angular units.
12. Select the MMGS (millimeter, gram, second) radio button from the Unit system area if
it is not selected by default. Also, select the Degrees option from the drop-down list
provided in the Angular units area.
13. Select Grid/Snap from the area on the left. Set the value of the Major grid spacing
spinner to 100 and the value of the Minor-lines per major spinner to 20.
14. Now, choose the Go To System Snaps button; the system options related to relations and
snap are displayed. Select the Grid check box from the Sketch Snaps area and make sure
that you clear the Snap only when grid is displayed check box.
The sketch of the model consists of an outer loop, two circles inside the outer loop,
and a cavity. Therefore, it will be drawn using the Line and the Circle tools. You
will first draw the outer loop and then the inner entities.
Department of Mechanical 17
Auroras Technological and Research Institute Auto Cad Lab
15. Choose the Line button from the Sketch CommandManager to invoke the Line tool.
The arrow cursor will be replaced by the line cursor.
16. Move the cursor in the first quadrant close to the origin. Draw the outer loop of the sketch
which is shown in Figure E.
17. The circles will be drawn using the Circle tool. You will use the inferencing line
originating from the start points and endpoints of the inclined lines to specify the
center point of the circles. As mentioned earlier, the cursor in the sketching
environment jumps through a distance of 10 mm by default. But the radius of the
circle is 5 mm and to specify this value, the cursor needs to jump only through a
distance of 5 mm. This is the reason you need to modify the document settings so
that the cursor jumps through a distance of 5 mm.
18. The sketch after drawing the two circles inside the outer loop is shown in Figure F.
Department of Mechanical 18
Auroras Technological and Research Institute Auto Cad Lab
19. Draw the sketch of the inner cavity. The final completed sketch for Excercise 1 is shown in
Figure G.
Department of Mechanical 19
Auroras Technological and Research Institute Auto Cad Lab
Exercise -2
Aim: To draw the basic sketch for the revolved solid model shown in Figure A. The sketch for
the revolved solid model is shown in Figure B. Do not dimension the sketch as the solid model
and the dimensions are given only for your reference.
Department of Mechanical 20
Auroras Technological and Research Institute Auto Cad Lab
Procedure:
1. Choose the New button from the Standard toolbar to invoke the New Solid Works
2. The Part button is chosen by default in the New Solid Works Document dialog box.
3. Choose the Sketch button from the Standard toolbar. The Edit Sketch Property
Manager is displayed. Select the Front plane to invoke the sketching environment.
4. Set the value of the Major grid spacing spinner to 50 and the value of the Minor-lines
5. The sketch consists of horizontal and vertical lines. Therefore, this sketch will be drawn
using the Line tool. You will start drawing from the lower left corner of the sketch.
6. Choose the Zoom to Fit button from the View toolbar to fit the sketch on the screen. The
Department of Mechanical 21
Auroras Technological and Research Institute Auto Cad Lab
Exercise -3
Aim: To draw the basic sketch of the model shown in Figure A. The sketch to be drawn is
shown in Figure B. Do not dimension the sketch as the solid model and the dimensions are
given only for your reference.
Department of Mechanical 22
Auroras Technological and Research Institute Auto Cad Lab
Procedure:
1. Choose the New button from the Standard toolbar to invoke the New Solid Works
Document dialog box.
2. The Part button is chosen by default in the New Solid Works Document dialog box.
Choose OK. A new Solid Works part document is started.
3. Choose the Sketch button from the Standard toolbar. The Edit Sketch Property
Manager is displayed. Select the Front plane to invoke the sketching environment.
4. Set the value of the Major grid spacing spinner to 50 and the value of the Minor-lines
per major spinner to 10.
5. The sketch consists of an outer loop and an inner circle. Therefore, this sketch will be
drawn using the Line and the Circle tools. You will start drawing from the lower left
corner of the sketch.
6. Draw the outer loop of the sketch as shown in Figure C.
7. Draw the circle using Circle button Figure D shows the final sketch for Tutorial3.
Department of Mechanical 23
Auroras Technological and Research Institute Auto Cad Lab
Exercise -4
Aim: To draw the basic sketch of the solid model shown in Figure A. The sketch for the model is
shown in Figure B. Do not dimension the sketch as the dimensions and the solid model are given
only for your reference.
Department of Mechanical 24
Auroras Technological and Research Institute Auto Cad Lab
Procedure:
1. Choose the New button from the Standard toolbar to invoke the New Solid Works
Document dialog box.
2. The Part button is chosen by default in the New Solid Works Document dialog box.
Choose OK. A new Solid Works part document is started.
3. Choose the Sketch button from the Standard toolbar. The Edit Sketch Property
Manager is displayed. Select the Front plane to invoke the sketching environment.
4. Set the value of the Major grid spacing spinner to 50 and the value of the Minor-lines
per major spinner to 10.
5. The sketch will be drawn using the Line tool. The arc in the sketch will also be drawn
using the same tool. You will start drawing from the lower left corner of the sketch.
6. Choose the Zoom to Fit button from the View toolbar to modify the drawing display
area. The final sketch for Tutorial 4 is shown in Figure C.
Department of Mechanical 25
Auroras Technological and Research Institute Auto Cad Lab
The initial screen, after starting the Edge CAM Part Modeler in the Model mode, is
Shown in the below figure.
FIG.: Initial screen display of the Edge CAM Part Modeler in the Model mode
There are two operating modes in the Edge CAM Part Modeler.
Department of Mechanical 26
Auroras Technological and Research Institute Auto Cad Lab
1.The Model mode of the Edge CAM Part Modeler is a feature-based parametric environment in
which you can create solid models.
2. Drawing Mode
The Drawing mode is used for the documentation of the parts created earlier in the form of
drawing views and their detailing.
Choose the Switch to Manufacture Mode button from the top right corner of the screen. The
screen display in the Manufacture mode is shown in figure.
Department of Mechanical 27
Auroras Technological and Research Institute Auto Cad Lab
1. Design Mode:
This mode offers a comprehensive set of tools for creating 2D and 3D geometries and
complex surfaces, which are later used in the Manufacturing mode for generating tool paths.
The Design mode offers two working environments, XY and ZX.
2. Manufacture Mode:
The Manufacture mode offers the tools for generating the tool paths for various milling,
turning, and wire EDM operations. You can enter the Manufacture mode by selecting
Options > Manufacture from the menu bar or by selecting the Switch to Manufacture Mode
button available at the top right corner of the Edge CAM screen.
The following system requirements are needed to ensure a smooth running of Edge CAM.
1. System unit: Current Intel Pentium compatible processor such as Pentium 4, Intel
XEON or AMD Athlon running Windows 2000 SP4 or Windows XP Professional.
2. Memory: 512 MB RAM minimum (1 GB for advanced systems).
3. Disk drive: 1GB free disk space.
4. Internal/External drives: A CD-ROM drive is required for program installation.
5. Display: Graphics Card capable of 1280 x 1024 high color setting & 64 Mb memory
6. 17" color monitors (minimum screen resolution of 1280 x 1024).
7. Wheel mouse.
8. Parallel Port for security key.
Department of Mechanical 28
Auroras Technological and Research Institute Auto Cad Lab
The tools in this toolbar are used for sketching a profile and creating features. Some tools
are grouped together. Also, the tool used last will be displayed in the toolbar. Figure shows the
Application Menu toolbar.
Department of Mechanical 29
Auroras Technological and Research Institute Auto Cad Lab
Excercise 1
Aim: Draw the sketch of the model shown in Figure A. The sketch is shown in Figure B.
Department of Mechanical 30
Auroras Technological and Research Institute Auto Cad Lab
Procedure:
1. Start a new file in the Edge CAM Part Modeler. Select the XZ Plane (front) from the
Model window to make it the active construction plane.
2. Choose Tools > Options > Document from the menu bar to invoke the Document
options dialog box. Set the value of the distance increment of the rectangular snap as 10,
10 in the Document options dialog box.
3. Draw one half of the sketch using the Line and Arc tool, as shown in Figure C.
4. The other half of the sketch is completed by mirroring the entities, as shown in Figure D.
Department of Mechanical 31
Auroras Technological and Research Institute Auto Cad Lab
5. Draw the inner rectangular cavity using the Rectangle tool. The final sketch is shown in
Figure E.
Excercise 2
Aim: Draw the sketch of the model shown in Figure A. The sketch is shown in Figure B.
Department of Mechanical 32
Auroras Technological and Research Institute Auto Cad Lab
Procedure:
Department of Mechanical 33
Auroras Technological and Research Institute Auto Cad Lab
1. Start a new file in the Edge CAM Part Modeler. Select the XZ Plane (front) from the
Model window to make it the active construction plane.
2. Draw the outer profile using the Line and Circle tool. The sketch is shown in Figure C.
3. After drawing the outer profile of the sketch, trim its unwanted portion using the
Quick trimming tool. The sketch after trimming is shown in Figure D.
4. Draw its inner loops, which consist of two circles that will be drawn using the Circle tool.
The final sketch is shown in Figure E.
Department of Mechanical 34
Auroras Technological and Research Institute Auto Cad Lab
CATIA V5R19
INTRODUCTION:
1. CATIA Stands for Computer Aided Three Dimensional Interactive Application.
Drafting Workbench
1. The Drafting workbench is used for the documentation of the parts or the assemblies
created earlier in the form of drawing views and their detailing.
2. There are two types of drafting techniques:
Department of Mechanical 35
Auroras Technological and Research Institute Auto Cad Lab
1. Generative drafting
2. Interactive drafting
SYSTEM REQUIREMENTS:
The following are the system requirements to ensure smooth running of CATIA
V5R16 on our system:
System unit: An Intel Pentium III or Pentium 4 based workstation running Microsoft
2000 Professional Edition or Windows XP Professional Edition.
Memory: 256 MB of RAM is the minimum recommended for all applications. 512
MB of RAM is recommended for DMU applications.
Feature-based Modeling
A feature is defined as the smallest building block that can be modified individually.
A model created in CATIA V5 is a combination of a number of individual features and
each feature is related to the other directly or indirectly.
Parametric Modeling
The parametric nature of a software package is defined as its ability to use the
Standard properties or parameters in defining the shape and size of a geometry.
CAT Part
CAT Part is a file extension associated with all the files that are created in
Sketcher, Part Design, and Wireframe and Surface Design workbenches of
CATIA V5.
CAT Product
CAT Product is a file extension associated with all the files that are created in
Assembly Design workbench of CATIA V5.
CAT Drawing
CAT Drawing is a file extension associated with all the files that are created in
Drafting workbench of CATIA V5.
Specification Tree
Department of Mechanical 36
Auroras Technological and Research Institute Auto Cad Lab
1. The specification tree keeps a track of all the operations that are carried on the
part, as shown in the figure.
2.The specification tree that appears when you start a new file under the Part
Design workbench, is as shown in the figure.
FIG.:The specification tree that appears on starting a new CAT Part file
Compass
2. You can also orient the view of the parts and assemblies.
The Compass
Constraints:
1. Constraints are logical operations that are performed on the selected element to define its
size and location with respect to other elements or reference geometries.
2. The constraints in Sketcher workbench are called geometric constraints and the
constraints available in the Assembly Design workbench are called assembly constraints.
Geometric Constraints:
These are the logical operations performed on sketched elements to define their size
and position with respect to other elements.
Exercise 1
Department of Mechanical 37
Auroras Technological and Research Institute Auto Cad Lab
Aim: To draw the sketch of the model shown in Figure A. The sketch is shown in Figure B.
You will not dimension the sketch. The solid model and the dimensions are given only for
your reference.
Procedure:
Department of Mechanical 38
Auroras Technological and Research Institute Auto Cad Lab
Exercise 2
Department of Mechanical 39
Auroras Technological and Research Institute Auto Cad Lab
Aim: To draw the sketch of the model shown in Figure A. The sketch is shown in Figure B.
You will not dimension the sketch. The solid model and the dimensions are given only for
your reference.
Procedure:
Department of Mechanical 40
Auroras Technological and Research Institute Auto Cad Lab
Figure (C): The sketch after drawing the three lines and a tangent arc
Figure (E): The final sketch after drawing the inner loop of the sketch
Exercise 3
Department of Mechanical 41
Auroras Technological and Research Institute Auto Cad Lab
Aim: To draw the sketch of the model, as shown in Figure A. The sketch is shown in Figure B.
You will not dimension the sketch. The solid model and dimensions are given for your reference.
Department of Mechanical 42
Auroras Technological and Research Institute Auto Cad Lab
Procedure:
1. Start a new CAT part file.
2. Draw the sketch of the model using the Rectangle, Profile, and Circle tools, as shown in
Figure C, Figure D and Figure E.
Department of Mechanical 43
Auroras Technological and Research Institute Auto Cad Lab
Exercise 4
Aim: To draw the sketch of the model shown in Figure A. The sketch is shown in Figure B. Do
not dimension the sketch. The solid model and the dimensions are given only for your reference.
Department of Mechanical 44
Auroras Technological and Research Institute Auto Cad Lab
Procedure:
1. Start a new CATpart file.
2. Draw the sketch of the model using the Profile and the Circle tools, as shown in
Figure C and Figure D.
Department of Mechanical 45
Auroras Technological and Research Institute Auto Cad Lab
Department of Mechanical 46
Auroras Technological and Research Institute Auto Cad Lab
Exercise 5
Aim: To draw the sketch of the model shown in Figure A. The sketch is shown in Figure B.
You will not dimension the sketch. The solid model and the dimensions are given only for your
reference.
Procedure:
1. Start a new file in the Part workbench and draw the outer loop of the sketch using
the Circle and By-Tangent Line tool, as shown in Figure C, Figure D, Figure E
and Figure F .
Department of Mechanical 47
Auroras Technological and Research Institute Auto Cad Lab
Figure (E): The sketch after drawing the first tangent line
Department of Mechanical 48
Auroras Technological and Research Institute Auto Cad Lab
Figure (F): The sketch, after drawing the second tangent line
2. Trim the unwanted portion of the outer loop of the sketch using the Quick Trim tool, as
shown in Figure G and Figure H.
3. Draw the inner loops of the sketch using the Circle tool, as shown in Figure I.
Department of Mechanical 49
Auroras Technological and Research Institute Auto Cad Lab
ANSYS 10.0
INTRODUCTION TO FEA:
1. The finite element analysis (FEA) is a computing technique that is used to obtain
Approximate solutions to the boundary value problems in engineering.
2. It uses a numerical technique called the finite element method (FEM) to solve
boundary value problems.
3. FEA involves a computer model of a design that is loaded and analyzed for specific
results
4. The concept of FEA can be explained with a small example of measuring the perimeter
of a circle, refer to Figure 1.
Department of Mechanical 50
Auroras Technological and Research Institute Auto Cad Lab
Better knowledge of FEA will help you build more accurate models. It will also help
you understand the backend working of ANSYS. Figure 2 shows a spring assembly that
represents a simple two-spring element model.
Stiffness Matrix:
The following part represents the stiffness matrix (K):
Degree of Freedom:
Degree of freedom is defined as the ability of a node to translate or transmit the load.
Boundary Conditions:
The boundary conditions are used to eliminate the unknowns in the system.
Nodes
Nodes are similar to the points in geometry and represent the corner points of an element,refer to
Figure 3.
Element Shapes:
The following are the basic shapes of the elements:
Department of Mechanical 51
Auroras Technological and Research Institute Auto Cad Lab
1. Point Element
A point element is in the form of a point and therefore has only one node
2. Line Element
A line element has the shape of a line or curve, therefore a minimum of two nodes are
required to define it, refer to Figure 4.
Department of Mechanical 52
Auroras Technological and Research Institute Auto Cad Lab
Solution
Department of Mechanical 53
Auroras Technological and Research Institute Auto Cad Lab
Solution phase is completely automatic. The FEA software generates the element
matrices, computes nodal values and derivatives, and stores the result data in files.
Postprocessor
The output from the solution phase (result data files) is in the numerical form and
consists of nodal values of the field variable and its derivatives.
Engineers
An engineer who wants to work with this tool should have sound knowledge of Strength
of Materials (for structural analysis), Heat Transfer, Thermodynamics (for thermal analysis), and
a good analytical/designing skill.
Software
The FEA software should be selected based on the following considerations:
1. Analysis type to be performed.
2. Flexibility and accuracy of the tool.
3. Hardware configuration of your system.
FEA Software
There are varieties of commercial FEA software packages available in market. Some of
the most popular and commercially available FEA software are as follows:
1. ANSYS
2. Adina
3. Abaqus
4. Hypermesh
5. NX Nastran
6. Cosmos
7. NISA
8. Marc
9. Ls-Dyna
10. MSC/Dytran
11. Star-CD
ANSYS developed by ANSYS, Inc., USA, is a dedicated Computer Aided Finite Element
Modeling and Finite Element Analysis tool. ANSYS is known as the standard in the field of
Computer Aided Engineering. The Graphical User Interface (GUI) of ANSYS enables the user to
work with 3-dimensional (3D) models and also generate results from them.
SYSTEM REQUIREMENTS:
Department of Mechanical 54
Auroras Technological and Research Institute Auto Cad Lab
Department of Mechanical 55
Auroras Technological and Research Institute Auto Cad Lab
Exercise 1
Aim: To create the beam shown in Figure 1. The dimensions of the beam are shown in the same
figure. Save it with the name mentioned below.
Procedure:
1. Invoke the ANSYS Product Launcher window and then start a new job.
2. Create key points using the In Active CS option, refer to Figure 2 and 3.
3. Create lines using the Straight Line option, refer to Figure 3 and 4
4. Save the job and exit the ANSYS session.
Department of Mechanical 56
Auroras Technological and Research Institute Auto Cad Lab
Department of Mechanical 57
Auroras Technological and Research Institute Auto Cad Lab
Exercise 2
Aim: to create the truss shown in Figure 1. Save it with the name mentioned below.
Procedure:
1. Invoke the ANSYS Product Launcher window and then start a new job.
2. Create key points using the In Active CS option refer to Figure-2 and 3
Department of Mechanical 58
Auroras Technological and Research Institute Auto Cad Lab
3.Create lines using the Straight Line option, refer to Figure 4 and 5.
Department of Mechanical 59
Auroras Technological and Research Institute Auto Cad Lab
Department of Mechanical 60
Auroras Technological and Research Institute Auto Cad Lab
Structural Analysis
Exercise 3
Aim: To find the displacement, maximum, minimum stresses induced in a given cantilever
beam and draw the shear force and bending moment diagrams by using ANSYS tool, also list the
results according to the given loads.
10N
5m
Procedure:
Preferences:
1. Main menu > preprocessor > element type > add/edit/delete > Add > select Beam -2D
elastic3 > click ok > close.
2. Main menu > preprocessor > Real constraints > Add/Edit/Delete > Add > Click ok >
Enter the following values Area=1, Area moment of Inertia ( IZZ)=1/12, Height=1, >
click ok > close.
3. Main menu > preprocessor > Material properties > Material model > structural > linear >
elastic > isotropic > enter Ex as 2E5 & PRXY as 0.3 > click ok > close.
4. Main menu > preprocessor > modeling > create > nodes > Inactive CS > (Enter X<Y<Z
location values) as shown in the figure starting from node-1 i.e., 0,0,0 and 10,0,0 thus two
nodes are created.
5. Main menu > preprocessor > modeling > create > element > auto numbered > through
nodes (select node by node and middle click ) with this elements are created.
Solution:
Department of Mechanical 61
Auroras Technological and Research Institute Auto Cad Lab
1. Solution > define loads > Apply > structural > displacement > pick on nodes (Pick the
node which are to be constrained with direction) > middle click > select DOF or UX or
UY or UZ as required > click ok.
Pick node-1 > middle click > select all DOF since to constrain the beam.
2. Solution > define loads > Apply > structural > force/moment > on nodes > select node >
middle click > select FX and FY or MZ depending on the problem > click ok. In the
above problem load acting downwards i.e. in negative Y-direction at node -2 of about
10N.
1) General post processor > element table > define table > add select by sequence number >
enter SMISC , 2,4,6,8,12 one after the other > click ok > close.
2) General post processor > plot results > deformed shape > click ok.
3) General post processor > plot results > contour plot > nodal solution > click ok.
4) General post processor > plot results > contour plot > element solution > click ok.
5) General post processor > plot results > contour plot > line element results > use the
6) Combination 2,8 for shear force diagram and 6,12 for bending moment diagram.
7) General post processor > plot results > vector plot > predefined > click ok.
8) General post processor > list results > nodal solution > click ok.
9) General post processor > list results > element solution > click ok.
Result: Thus the analysis on the given beam is performed using ANSYS tool, Shear force
,bending moment diagrams are captured and values are noted.
Viva Questions
1. What is ANSYS?
2. Why ANSYS is used?
3. What is Structural Analysis?
4. What is Thermal Analysis?
Department of Mechanical 62
Auroras Technological and Research Institute Auto Cad Lab
Exercise 4
Aim: To find the displacement, maximum, minimum stresses induced in a given cantilever
beam with uniformly distributed load and point loads and draw the shear force and bending
moment diagrams by using ANSYS tool, also list the results according to the given loads.
3t 10N/m 2.5t
1m 1.5m 2m 1m
Procedure:
Preferences:
1) Main menu > preprocessor > element type > add/edit/delete > Add > select Beam -2D
elastic3 > click ok > close.
2) Main menu > preprocessor > Real constraints > Add/Edit/Delete > Add > Click ok >
Enter the following values Area=1, Area moment of Inertia ( IZZ)=1/12, Height=1, >
click ok > close.
3) Main menu > preprocessor > Material properties > Material model > structural > linear >
elastic > isotropic > enter Ex as 2E5 & PRXY as 0.3 > click ok > close.
4) Main menu > preprocessor > modeling > create > nodes > Inactive CS > (Enter X<Y<Z
location values) as shown in the figure starting from node-1 i.e., 0,0,0 and 1,0,0, 2.5,0,0,
4.5,0,0, 5,0,0 thus five nodes are created.
Department of Mechanical 63
Auroras Technological and Research Institute Auto Cad Lab
5) Main menu > preprocessor > modeling > create > element > auto numbered > through
nodes (select node by node and middle click ) with this elements are created.
Solution:
1. Solution > define loads > Apply > structural > displacement > pick on nodes
(Pick the node which are to be constrained with direction) > middle click > select
DOF or UX or UY or UZ as required > click ok.
Pick node-1 > middle click > select all DOF since to constrain the beam.
2. Solution > define loads > Apply > structural > force/moment > on nodes > select
node > middle click > select FX and FY or MZ depending on the problem > click
ok. In the above problem load acting downwards i.e. in negative Y-direction at
node -2 and 5 of about 3tones and 2.5 tones.
3. Solution > define loads > apply > structural > pressure (applied or uniformly
distributed load) > on beams > select beam middle click(Enter pressure value at
the both ends) i.e., at I & J , enter 1 and 1 > click ok
Solution > solve > click ok.
General post processor:
1. General post processor > element table > define table > add select by sequence
number > enter SMISC , 2,4,6,8,12 one after the other > click ok > close.
2. General post processor > plot results > deformed shape > click ok.
3. General post processor > plot results > contour plot > nodal solution > click ok.
4. General post processor > plot results > contour plot > element solution > click ok.
5. General post processor > plot results > contour plot > line element results > use
the
6. Combination 2,8 for shear force diagram and 6,12 for bending moment diagram.
7. General post processor > plot results > vector plot > predefined > click ok.
8. General post processor > list results > nodal solution > click ok.
9. General post processor > list results > element solution > click ok.
Result: Thus the analysis on the given beam is performed using ANSYS tool, Shear force,
bending moment diagrams are captured and values are noted.
Department of Mechanical 64
Auroras Technological and Research Institute Auto Cad Lab
Viva Questions
1. What is nodal solution?
2. What is pre processor?
3. What is post processor?
4. What is modeling?
5. What type of options we use in preferences?
6. ANSYS is it a tool or software?
7. What is the difference between Animation and Modeling?
8. What is DOF?
9. How to create a Node?
10. How to create an Element?
Exercise 5
Aim: To find the displacement, maximum, minimum stresses induced in a given cantilever
beam with uniformly distributed load and point loads and draw the shear force and bending
moment diagrams by using ANSYS tool, also list the results according to the given loads.
Procedure:
Preferences:
Preprocessor:
1. Main menu > preprocessor > element type > add/edit/delete > Add > select Beam
-2D elastic3 > click ok > close.
2. Main menu > preprocessor > Real constraints > Add/Edit/Delete > Add > Click
ok > Enter the following values Area=1, Area moment of Inertia (IZZ)=1/12,
Height=1, > click ok > close.
Department of Mechanical 65
Auroras Technological and Research Institute Auto Cad Lab
3. Main menu > preprocessor > Material properties > Material model > structural >
linear > elastic > isotropic > enter Ex as 2E5 & PRXY as 0.3 > click ok > close.
4. Main menu > preprocessor > modeling > create > nodes > Inactive CS > (Enter
X<Y<Z location values) as shown in the figure starting from node-1 i.e., 0,0,0
and 1,0,0, 0.5,0,0, 1,0,0, 1.5,0,0 , 2,0,0 thus six nodes are created.
5. Main menu > preprocessor > modeling > create > element > auto numbered >
through nodes (select node by node and middle click ) with this elements are
created.
Solution:
1. Solution > define loads > Apply > structural > displacement > pick on nodes
(Pick the node which are to be constrained with direction) > middle click > select
DOF or UX or UY or UZ as required > click ok.
Pick node-1 > middle click > select all DOF since to constrain the beam.
2. Solution > define loads > Apply > structural > force/moment > on nodes > select
node > middle click > select FX and FY or MZ depending on the problem > click
ok. In the above problem load acting downwards i.e. in negative Y-direction at
node -2 ,3,4,5and 5 of about 400kg.300kg.800kg.500kg and at node-1 a force in
MZ direction of about 2700 kgm is acting , pick node-1 > middle click > select
MZ > enter value as 2700.
1. General post processor > element table > define table > add select by sequence
number > enter SMISC , 2,4,6,8,12 one after the other > click ok > close.
2. General post processor > plot results > deformed shape > click ok.
3. General post processor > plot results > contour plot > nodal solution > click ok.
4. General post processor > plot results > contour plot > element solution > click ok.
5. General post processor > plot results > contour plot > line element results > use
the
6. Combination 2,8 for shear force diagram and 6,12 for bending moment diagram.
7. General post processor > plot results > vector plot > predefined > click ok.
8. General post processor > list results > nodal solution > click ok.
9. General post processor > list results > element solution > click ok.
Department of Mechanical 66
Auroras Technological and Research Institute Auto Cad Lab
Result: Thus the analysis on the given beam is performed using ANSYS tool,Shear force
bending moment diagrams are captured and values are noted.
Viva Questions
1. What is steady state Analysis?
2. What is unsteady state Analysis?
3. What are the types of Thermal Analysis?
4. What is task in Thermal Analysis?
5. How to apply loads in Thermal Analysis?
6. How to apply loads in Structural Analysis?
7. What is load?
8. What is structure?
9. What is beam?
10. What is Shear force?
Exercise 6
Aim: To find the displacement, maximum, minimum stresses induced in a given simply
supported beam and draw the shear force and bending moment diagrams by using ANSYS tool,
also list the results according to the given loads.
1.5m 2.5m 2m 2m
Procedure:
Preferences:
Preprocessor:
Department of Mechanical 67
Auroras Technological and Research Institute Auto Cad Lab
1. Main menu > preprocessor > element type > add/edit/delete > Add > select Beam
-2D elastic3 > click ok > close.
2. Main menu > preprocessor > Real constraints > Add/Edit/Delete > Add > Click
ok > Enter the following values Area=1, Area moment of Inertia
( IZZ)=1/12, Height=1, > click ok > close.
3. Main menu > preprocessor > Material properties > Material model > structural >
linear > elastic > isotropic > enter Ex as 2E5 & PRXY as 0.3 > click ok > close.
4. Main menu > preprocessor > modeling > create > nodes > Inactive CS > (Enter
X<Y<Z location values) as shown in the figure starting from node-1 i.e., 0,0,0
and 1.5,0,0, 3.5,0,0, 5.5,0,0, 7.5,0,0 , 2,0,0 thus five nodes are created.
5. Main menu > preprocessor > modeling > create > element > auto numbered >
through nodes (select node by node and middle click ) with this elements are
created.
Solution:
1. Solution > define loads > Apply > structural > displacement > pick on nodes (Pick the
node which are to be constrained with direction) > middle click > select DOF or UX or
UY or UZ as required > click ok
Pick node-1 > middle click > select all DOF since to constrain the beam.
2. Solution > define loads > Apply > structural > force/moment > on nodes > select node >
middle click > select FX and FY or MZ depending on the problem > click ok. In the
above problem load acting downwards i.e. in negative Y-direction at node -2, 3,4 of
about 4KN, 10KN, 7KN.
1. General post processor > element table > define table > add select by sequence number >
enter SMISC , 2,4,6,8,12 one after the other > click ok > close.
2. General post processor > plot results > deformed shape > click ok.
3. General post processor > plot results > contour plot > nodal solution > click ok.
4. General post processor > plot results > contour plot > element solution > click ok.
5. General post processor > plot results > contour plot > line element results > use the
6. Combination 2,8 for shear force diagram and 6,12 for bending moment diagram.
Department of Mechanical 68
Auroras Technological and Research Institute Auto Cad Lab
7. General post processor > plot results > vector plot > predefined > click ok.
8. General post processor > list results > nodal solution > click ok.
9. General post processor > list results > element solution > click ok.
Result: Thus the analysis on the given beam is performed using ANSYS tool, Shear
force, bending moment diagrams are captured and values are noted
Viva Questions
1. What is Bending Moment?
2. What is Cantilever Beam?
3. What is Simply Supported Beam?
4. What are the types of Beams?
5. What are the types of Loads?
6. What is overhanging Beam?
7. What is UDL?
8. What is Work?
9. What are the units for Work?
10. What is General post processor?
Exercise 7
Aim:
To find the displacement, maximum, minimum stresses induced in a given cantilever beam with
uniformly distributed load and point loads and draw the shear force and bending moment
diagrams by using ANSYS tool, also list the results according to the given loads.
10kN
20kN/m
5m 2m
Procedure:
Preferences:
Department of Mechanical 69
Auroras Technological and Research Institute Auto Cad Lab
Preprocessor:
1.Main menu > preprocessor > element type > add/edit/delete > Add > select Beam -2D
elastic3 > click ok > close.
2. Main menu > preprocessor > Real constraints > Add/Edit/Delete > Add > Click ok >
Enter the following values Area=1, Area moment of Inertia ( IZZ)=1/12, Height=1, >
click ok > close.
3. Main menu > preprocessor > Material properties > Material model > structural > linear >
elastic > isotropic > enter Ex as 2E5 & PRXY as 0.3 > click ok > close.
4. Main menu > preprocessor > modeling > create > nodes > Inactive CS > (Enter X<Y<Z
location values) as shown in the figure starting from node-1 i.e., 0,0,0 and 5,0,0, 1,0,0,
7,0,0 thus three nodes are created.
5. Main menu > preprocessor > modeling > create > element > auto numbered > through
nodes (select node by node and middle click ) with this elements are created.
Solution:
1. Solution > define loads > Apply > structural > displacement > pick on nodes
(Pick the node which are to be constrained with direction) > middle click > select
DOF or UX or UY or UZ as required > click ok.
Pick node-1 > middle click > select all DOF since to constrain the beam.
2. Solution > define loads > Apply > structural > force/moment > on nodes > select
node > middle click > select FX and FY or MZ depending on the problem > click
ok. In the above problem load acting downwards i.e. in negative Y-direction at
node -2 and 5 of about 3tones and 2.5tones.
3. Solution > define loads > Apply > structural > pressure (applied or uniformly
distributed load) > on beams > select beam middle click (Enter pressure value at
the both ends) i.e. at I & J enter 20 and 20 > click ok.
1. General post processor > element table > define table > add select by sequence number >
enter SMISC , 2,4,6,8,12 one after the other > click ok > close.
2. General post processor > plot results > deformed shape > click ok.
3. General post processor > plot results > contour plot > nodal solution > click ok.
Department of Mechanical 70
Auroras Technological and Research Institute Auto Cad Lab
4. General post processor > plot results > contour plot > element solution > click ok.
5. General post processor > plot results > contour plot > line element results > use the
6. Combination 2, 8 for shear force diagram and 6, 12 for bending moment diagram.
7. General post processor > plot results > vector plot > predefined > click ok.
8. General post processor > list results > nodal solution > click ok.
9. General post processor > list results > element solution > click ok.
Result: Thus the analysis on the given beam is performed using ANSYS tool, Shear
force, bending moment diagrams are captured and values are noted
Viva Questions
1. What is Temperature?
2. How to convert degree Celsiuss to Farehein Heat?
3. What are the units of Temperature?
4. What is Zero Temperature?
5. What is UVL?
6. What is Heat?
7. What are the units of Heat?
8. Draw the B.M of U.D.L?
9. What is point of contraflucture?
10. In what beams point of contrafluture occurs?
Structural Analysis
Solid Modeling
Aim: To find the displacement, maximum, minimum stresses induced in a given solid structure
with uniformly distributed load and point loads by using ANSYS tool, also list the results
according to the given loads.
10m
10m
10m
Department of Mechanical 71
Auroras Technological and Research Institute Auto Cad Lab
Procedure:
Preferences:
Main menu > preferences > check structural
Preprocessor:
1. Main menu > preprocessor > element type > add/edit/delete > Add > select Brick 8 node 45
> ok > close.
2. Main menu > preprocessor > Material properties > Material model > structural > linear >
elastic > isotropic > enter Ex as 2E5 & PRXY as 0.3 > click ok > close.
3. Main menu > preprocessor > modeling > create > key points > enter values as follows i.e.,
0,0,0 , 10,0,0, 10,0,0, 0,10.0, 5,5,0 thus key points are generated.
4. Main menu > preprocessor > modeling > create > lines > straight lines> pick each key
point individually starting from 1 to 1 > click ok( with this lines square is created).
5. Main menu > preprocessor > modeling > create > lines > arcs > full circle > pick the key
point 5 draw a circle with radius nearly 2.
6. Main menu > preprocessor > modeling > create > areas > arbitrary > by lines > pick
straight lines of a square thus area of square is created > plot > lines.
7. Main menu > preprocessor > modeling > create > areas > arbitrary > by lines > pick circle
lines, thus circle area is created.
8. Main menu > preprocessor > modeling > operate > Booleans > subtract > areas pick square
area first > click ok > pick circle area > click ok , then circle area is subtracted from the
square area.
9. Main menu > preprocessor > modeling > operate > extrude > areas > along normal > pock
the structure on the screen > click ok > enter length of extrude value 10 > click ok.
10. Main menu > preprocessor > meshing > mesh tool > click on global set > enter element
edge length value as 0.1 > click ok > click. Mesh > select solid structure on the screen.
Solution:
17 Solution > define loads > Apply > structural > displacement >
pick on nodes (Pick the node which are to be constrained with
direction) > middle click > select DOF or UX or UY or UZ as
required > click ok In this problem make constraint All DOF
inside the circle, pick the whole area with mouse.
18 Solution > define loads > Apply > structural > force/moment >
on nodes > select node > middle click > select FX and FY or MZ
depending on the problem > click ok. Here 4 key points are in Z
direction and 4 key point are in +Z direction with load 20.
19 Solution > define loads > Apply > structural > pressure (applied
or uniformly distributed load) > areas > select areas middle click
(Enter pressure value at the both ends) i.e.20 > click ok.
Solution > solve > ok.
Department of Mechanical 72
Auroras Technological and Research Institute Auto Cad Lab
1. General post processor > plot results > deformed shape > ok.
2. General post processor > plot results > counter plot > nodal solution > ok.
3. General post processor > plot results > counter plot > element solution > ok.
4. General post processor > plot results > vector plot > predefined > ok.
5. General post processor > linear results > nodal solution > ok.
6. General post processor > list results > element solution > ok.
Result: Thus the analysis on the given solid structure is performed using ANSYS tool,
Maximum, minimum stresses are found with respective to the given loads and values are noted.
Viva Questions
Department of Mechanical 73
Auroras Technological and Research Institute Auto Cad Lab
Thermal Analysis
Aim: To determine the nodal temperature distribution, to determine the maximum value of
temperature in the given fin structured component by using ANSYS tool, also list the results
according to the given thermal conditions.
2cm
Aluminium 1cm
1cm
2cm Copper
(Heat Gen.) 3cm
1cm
5cm
Procedure:
1. Click workplace > WP settings > check the Cartesian and grid only buttons >
enter the following values > snapiner = 0.01, spacing = 0.01, minimum =0,
maximum=0.2, tolerance = 0.003 > ok.
2. Go to the ANSYS Main menu > preprocessor > modeling > create > areas >
rectangle > 2 corners.
3. Now pick the end points of the rectangle. First make the steel rectangle of
dimensions 5cm X 3cm i.e. 5 units by 3 units on the grid > next make the copper
square of dimensions 1cm X 1cm > next make the aluminium part by making a
rectangle of dimensions 5cm X 2cm and then creating two smaller rectangles,
which can then be subtracted from the main part to make the fins > from
preprocessor, choose modeling > operate > Boolean > overlap > areas.
4. Choose the steel area and then the aluminium area, and the click ok. The reason
why we dont give the copper and the steel is that they overlap. Picture a copper
plate resting on the steel area.
Department of Mechanical 74
Auroras Technological and Research Institute Auto Cad Lab
5. The steel and aluminium are connected more intimately, and must be glued
together > if you cannot see the complete work plane then go to utility men > plot
controls > pan, zoom, rotate and zoom out to see the entire work plane > the
model should look like the one below.
Material Properties:
Define material properties separately for steel aluminium and copper > click preprocessor
> material props > material models. In the window that comes up choose Thermal >
Conductivity > Isotropic > enter 1 for the material property number and click ok > fill in 20 for
Thermal conductivity Click ok > Now the material has the properties defined in the above table.
This represents the material properties for steel. Repeat the above steps to create material
properties for aluminium (k=180, material number 2), and copper (k=386, material number 3).
Do this by selecting material > new model in the Define Material Model Behavior window.
Element Properties:
Click processor > element Type > Add/Edit > Delete the Element Types window that
opens Click on Add> Type1 in the Element type reference number > Click on Thermal mass
solid and select Quad 8 nodes 77. Click ok. Close the Element Types window > so now we
have selected Element Type1 to be a thermal solid 8 node element. The component will now be
modeled with thermal solid 8 node element. This finishes the selection of element type.
Meshing
Go to preprocessor > Meshing > size controls > manual size > lines > All lines. In the
menu that comes up type 0.01 in the Field for Element edge length > Click on ok. Now when
you mesh the figure ANSYS will automatically create meshes that have an edge length of 0.01 m
along the lines you selected > First we will mesh the steel area. Go to preprocessor > meshing >
mesh attributes > Default Attributes > Now go to preprocessor > Meshing > mesh > Areas >
Free pick the steel area and click ok > Repeat the same process for the aluminum and copper
areas. Make sure you use the correct material number ( 2 and 3 respectively) for both areas. Also
since the steel and the copper areas overlap make sure you pick the right area. If you choose the
wrong area use preprocessor > meshing > Clear to undo the previous mesh and the repeat the
previous steps.
Department of Mechanical 75
Auroras Technological and Research Institute Auto Cad Lab
Solution:
Go to ANSYS Main menu > solution > Analysis type > New Analysis > select steady
state and click on ok > Go to solution > solve > currents LS > an error window may appear.
Click ok on that window and ignore it > wait for ANSYS to solve the problem > click on Ok and
close the Information window.
Post Processor:
Go to ANSYS Main menu General post processing > list > Result > Nodal solution.
Select DOF solution and temperature. Click ok
Go to General post processing > plot results > counter plot > Nodal solution.
Select DOF solution and temperature to be plotted and click ok.
Result: Thus the Thermal analysis on the given structures performed using ANSYS tool and
nodal distribution temperature is captured.
Viva Questions
1. What is Temperature?
2. How to convert degree Celsiuss to Farehein Heat?
3. What are the units of Temperature?
4. What is Zero Temperature?
5. What are the types of Thermal Analysis?
6. What is task in Thermal Analysis?
7. How to apply loads in Thermal Analysis?
8. How to apply loads in Structural Analysis?
9. What is load?
Department of Mechanical 76
Auroras Technological and Research Institute Auto Cad Lab
CNC TURNING
Exercise 1
5 10
10 5
R5 5
R5
25 20 15
10
Procedure:
G21
G98
G28 U0 W0
M06 T1
M03 S1500
G00 X26 21
G71 V0.5 R1
G71 P1 Q2 U0.1 W0.1 F50
N1 G01 X10 20
G01 X15 2-5
G01 X15 2-15
G02 X15 2-20 R5
G01 X20 2-30
N2 G03 X25 2-35 R5
G70 P1 Q2 S2000 F30
G28 U0 W0
M05
M30
Department of Mechanical 77
Auroras Technological and Research Institute Auto Cad Lab
Viva Questions
5. What is N series?
7. What is Counter?
8. What is M98?
Department of Mechanical 78
Auroras Technological and Research Institute Auto Cad Lab
CNC MILLING
Exercise 1
Procedure:
G21 G94
G91 G28 Z0
G28 X0 Y0
M03 S 1200
G90 G00 X0 Y0 Z0
G90 G00 X35 Y25 Z5
G01 Z-0.5 F40
G02 X25 Y35 R10
G02 X-25 Y35 R50
X-35 Y25 R10
X-35 Y-25 R50
X-25 Y-35 R10
X25 Y-35 R50
X35 Y-25 R10
X35 Y25 R50
G00 Z10
G91 G28 Z0
G28 X0 Y0
M05
M30
Viva Questions
1. What is mean by G00?
2. What is mean by G74?
3. What is mean by G20?
4. What is mean by G21?
5. Name any five preparatory codes?
6. What is meant by dwell?
7. What is G98?
8. What is G75?
9. What is G90?
10. What is G94?
Department of Mechanical 79
Auroras Technological and Research Institute Auto Cad Lab
8.3D Transformation*
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
#include<math.h>
int maxx,maxy,midx,midy;
void axis()
{
getch();
cleardevice();
line(midx,0,midx,maxy);
line(0,midy,maxx,midy);
}
void main()
{
int gd,gm,x,y,z,o,x1,x2,y1,y2;
detectgraph(&gd,&gm);
initgraph(&gd,&gm,"e:\tc\bgi");
setfillstyle(0,getmaxcolor());
maxx=getmaxx();
maxy=getmaxy();
midx=maxx/2;
midy=maxy/2;
axis();
bar3d(midx+50,midy-100,midx+60,midy-90,5,1);
Department of Mechanical 80
Auroras Technological and Research Institute Auto Cad Lab
axis();
printf("After scaling<BR>);
bar3d(midx+(x*50),midy-(y*100),midx+(x*60),midy-(y*90),5*z,1);
axis();
bar3d(midx+50,midy-100,midx+60,midy-90,5,1);
printf("Enter rotating angle<BR> );
scanf("%d",&o);
x1=50*cos(o*3.14/180)-100*sin(o*3.14/180);
y1=50*sin(o*3.14/180)+100*cos(o*3.14/180);
x2=60*cos(o*3.14/180)-90*sin(o*3.14/180);
y2=60*sin(o*3.14/180)+90*cos(o*3.14/180);
axis();
printf("After rotation about z axis<BR> );
bar3d(midx+x1,midy-y1,midx+x2,midy-y2,5,1);
axis();
printf("After rotation about x axis <BR>);
bar3d(midx+50,midy-x1,midx+60,midy-x2,5,1);
axis();
printf("After rotation about y axis <BR>);
bar3d(midx+x1,midy-100,midx+x2,midy-90,5,1);
getch();
Department of Mechanical 81
Auroras Technological and Research Institute Auto Cad Lab
closegraph();
}
9.BEZIER CURVE*
Procedure:
#include<stdio.h>
#include<conio.h>
#include<graphics.h>
int x,y,z;
void main()
{
float u;
int gd,gm,ymax,i,n,c[4][3];
c[4][0]=c[0][0];
c[4][1]=c[0][1];
detectgraph(&gd,&gm);
initgraph(&gd,&gm,"e:\\tc\\bgi");
ymax = 480;
setcolor(13);
for(i=0;i<3;i++)
{
line(c[i][0],ymax-c[i][1],c[i+1][0],ymax-c[i+1][1]);
}
setcolor(3);
n=3;
Department of Mechanical 82
Auroras Technological and Research Institute Auto Cad Lab
for(i=0;i<=40;i++)
{
u=(float)i/40.0;
bezier(u,n,c);
if(i==0)
{ moveto(x,ymax-y);}
else
{ lineto(x,ymax-y); }
getch();
}
getch();
}
bezier(u,n,p)
float u;int n; int p[4][3];
{
int j;
float v,b;
float blend(int,int,float);
x=0;y=0;z=0;
for(j=0;j<=n;j++)
{
b=blend(j,n,u);
x=x+(p[j][0]*b);
y=y+(p[j][1]*b);
z=z+(p[j][2]*b);
}
}
float blend(int j,int n,float u)
{
int k;
float v,blend;
v=C(n,j);
for(k=0;k<j;k++)
{ v*=u; }
for(k=1;k<=(n-j);k++)
{ v *= (1-u); }
blend=v;
return(blend);
}
C(int n,int j)
{
int k,a,c;
a=1;
for(k=j+1;k<=n;k++) { a*=k; }
for(k=1;k<=(n-j);k++) { a=a/k; }
c=a;
return(c);}
Department of Mechanical 83
Auroras Technological and Research Institute Auto Cad Lab
Department of Mechanical 84