Oaoaoa

Páginas: 5 (1183 palabras) Publicado: 10 de agosto de 2012
Exam. Programing IM-024. Introduction to CAD CAM Systems Aug 03, 2012 Prof. Dr. Ing Oscar E. Ruiz S.
I am aware that this test must be answered individually and only counting with the allowed information. I have been informed that I cannot introduce to the test room any files of any type, or electronic devices. I know that accepting / giving information of any type to other student, by anytechnological means during this test collides with the disciplinary rules of EAFIT University and causes the grading of the test with 0.0 score and a report to the Academic Board of the University.

Student Name:

Student ID:

1

Indications
1. Sign and write the date of the exam. 2. Arrange all graphics in the following way: (a) Use the same sequence: axis([xmin, xmax, ymin, ymax, zmin, zmax])axis equal to dimension all Figures. 3. Read the complete exam before starting. 4. Functions or files given to you at the beginning of the exam: plt_axes_str(cords, L, A, B, C,label_x,label_y,label_z,label_o) vertebra_Geom.txt, vertebra_Topo.txt

2

Reading of the Geometry and Topology Information

Write the function: function [points,triangs]=read_pseudo_vrml(geom_file_name,topo_file_name)% INPUTS: % geom_file_name: file with a (Nv x 3) array of real numbers. % % % % The (x,y,z) cartesian coordinates of line ’i’ correspond to the vertex ’i’ of a triangular shell. The (k,l,m) integer indexes in the line ’i’ are the indexes of the triangle vertices in the Geometry File. 1

% topo_file_name: file with a (Nf x 3) array of integer numbers.

% % % % % OUTPUTS: % points: % % triangs:%

The indices of the vertices start in ZERO, not in ONE. For this exercise you can assume that all the triangular face vertices are enumerated in CCW order w.r.t. the external normal vector. You do not need to order the faces.

(Nv x 3 ) array or real numbers. Column ’j’ corresponds to the coordinates of a planar face vertex. (Nf x 3) array of integer numbers. Entry ’j’ corresponds to theindices of the three vertices of face ’j’. The indices

% of the vertices start in ONE.

3

Filled Solid Display Function

Write the function function draw_fill_solid(verts, loops, face_color) % This function draws a polyhedron withouth holes % whose faces are filled with a color % INPUTS: % verts: % % loops: % % face_color: % % (Nv x 3) or (Nv x 4) array or real numbers. Row ’i’ containsthe coordinates x,y,x of the vertex ’i’. (Nf x 3) array of integer numbers. Row ’i’ corresponds to the indices of the vertices of triangle ’i’. One of ’m’, ’c’, ’b’, ’y’, ’g’, ’r’, ’k’ corresponding to the color to draw the faces of the solid. If face_color is ’X’ the drawing is in wireframe format with color ’k’.

4

Main

Program a ’main path.m’ function which performs the following actions:4.1

Data Initialization and File Input

1. Clear the working space, figures and MATLAB prompt. 2. Define the following constants as follows: (a) O0 = [3450, 3917, 65]T (b) Delta = [3300, 3700, 0]T (c) WORLD as the 4 × 4 identity matrix. (d) AXES SIZE=50 2

(e) S0 is the 4 × 4 identity matrix, but with S0 (1 : 3, 4) = O0 . 3. Load the vertebra Geom.txt and vertebra Topo.txt files by usingread pseudo vrml( ). The results of such a call must be called points cart (N points × 3) and triangles (Nf × 3). 4. Register in N points the number of vertices in the data set. 5. Open a figure and draw the object there with the draw fill solid( ) function, using solid BLUE color. 6. Define the point set points h (4 × N points) in this manner: points h(1:3,:) and points h(4, :) is filled with ones(1). 7. Open a second figure, to draw there the coordinate system W ORLD with the following parameters AXES SIZE, colors ’k’, ’b’, ’r’ and labels ’Xw’,’Yw’,’Zw’,’Ow’. Hold the figure ON. All subsequent drawing operations will appear in figure 2, unless said otherwise. = points cart’

4.2

Translation

1. Define M1 as the 4 × 4 identity matrix, but with M1 (1 : 3, 4) = −Delta. 2. Calculate...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Oaoaoa
  • oaoaoa

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS