Assignment 1

Fabian Prada

Part I

1)STL Data Structures

  1. stlTriangle: This class stores the coordinates of the vertices for a single triangle.
  2. Attributes



  3. stlTriangulation: This class stores the required attributes of the triangulation.
  4. Attributes

2)STL Implementation

Initialization

The initialization is done from a octahedron triangulation (T(0)). This triangulation contains 8 triangles. Each triangle knows the values x_1,y_1,z_1;x_2,y_2,z_2;x_3,y_3,z_3 of its vertices coordinates.

Subdivision

Input: Triangulation T(i) where all attributes are initiallized.

Part II

1)OFF Data Structures

  1. Triangle: This class stores the attributes of a single triangle.
  2. estructura.png

    Attributes



  3. Triangulation: This class stores the main attributes of the triangulation.
  4. Attributes

2)OFF Implementation

Initialization

The initialization is done from a octahedron triangulation (T(0)). This triangulation contains 8 triangles and 6 vertices. For each triangle, the values V_1,V_2,V_3,t_1,t_2, and t_3, are stored satisfying the orientation criteria explained above. The values M_1,M_2 and M_3 are set to -1, to indicate they are not initialized yet.

Subdivision

Input: Triangulation T(i) where all attributes are initiallized, except by the midpoints of the triangles.

3)Results

Octahedron octahedron.png
Subdivision 1 sub1.png
Subdivision 2 sub2.png
Subdivision 3 sub3.png
Subdivision 4 sub4.png