Homework 01 Marking scheme and feedback
triangulated OBJ output [3]
- 3 - all good
- 2 - good, but normals incorrect
- 1 - triangles are there but there are serious problems (non manifoldness) [1]
generalised map CSV output [4]
- 1 point for correct CSV format
- 1 point for correct element counts and no involutions pointing to an invalid dart
- 1 point for passing all involution tests (1/2 pt for partial succes)
- 1 point for passing all cell traversal tests (1/2 pt for partial succes)
code clarity [2]
- 2 - decent comments
- 0 - no comments
code runs [1]
- 1 - code runs without issues
Overall feedback
Most teams got a good OBJ output. The generalised map output was more mixed, although most teams also did a decent job here.
To my surprise no one actually used the gmap data structure (ie. the involutions and cell-dart references) to generate the barycenters for the triangulation. Everyone used a ‘hack’ to store an explicit vertex list on the faces and edges, which kind of defeats the point of having the gmap. Some groups also hardcoded how many vertices each face has (in the example inputs this was always 4, so it worked), it is much better to write your code in a general way so that it can handle any number of vertices in a face. No points were subtracted for that however.
Example of how to use the gmap references to traverse a Face to visit all its vertices to compute the barycenter:
struct Face {
Point* barycenter = nullptr;
Dart* dart = nullptr;
...
void compute_barycenter() {
auto start = this->dart;
Dart* cur = start;
Point sum;
int count = 0;
// collect the vertices around this face
do {
sum += *cur->vertex->barycenter;
++count;
cur = cur->a0->a1;
} while (cur!=start);
this->barycenter = new Point();
*(this->barycenter) = sum / count;
}
};
To test the validity of your gmap CSV output I performed a number of tests:
- I counted the number of darts and cells
- I checked for all darts if
dart->a0->a0 == dart
,dart->a1->a1 == dart
,dart->a2->a2 == dart
(involutions test) - I performed cell traversal (somewhat similar to the snippet above) to visit all the incident darts:
- traverse all the darts around each vertex (and visiting the incident edges around the vertex)
- traverse all the darts around each edge (and visiting the incident vertices of the edge)
- traverse all the darts around each face (and visiting the incident vertices/edges of the face)