Files to download today
- PS2.zip: Mesh data and
an basic template code.
Instructions
The zip package includes the following 3 directories:
- data: This directory contains several files,
which represent different triangle meshes on which you can test
your implementation. Each file has the extension .off,
which is one of the standard file formats for
representing triangle mesh data. Please take a look at
one of the files to see the structure of the data. The format is given
as follows: the first line contains the header OFF
The next line contains nv nf 0, which stand
for, respectively, number of vertices, number of
faces, and number of quads (0 in our case). After this
line, you will see nv lines which represent
the X,Y,Z coordinates of the points. After that,
there are nf lines that represent the indices
of the vertices in the triangles as follows: 3 v1
v2 v3 . For example a line 3 10 0 2,
says that there is a triangle with vertices 10, 0 and
2, where the numbering of the vertices is given
according to the first list (starting with 0).
- external This directory contains two files
that will be useful in handling the triangle
meshes. The first:
read_off_shape allows you to read the
triangle mesh from an 'off' file, into a MATLAB
data-structure. The second: plot_mesh allows
you to visualize a triangle mesh using MATLAB's
internal trimesh command.
- code . You should use this directory to store
and organize your code. By default it only contains
one file: process_mesh.m which will help you
to get started with your implementation.