Assignment #1:
Mesh Subdivision

Submission date: Friday, 9/24/21, 23:59

Objective:

Learn to use a real-life medium sized programming environment & data structure for meshes.

1. Experiment with the mesh editting API provided in here
2. Perform simple data-structure operations
3. Experiment with mesh subdivision schemes
4. Experiment with a mesh viewer GUI

Instructions:

The assignment consists of two components: getting the mesh editting library provided running and then coding at least one subdivision algorithm using the provided API.

Installation of the mesh editting library:

• Read the provided README carefully, to learn how to compile and use the codebase.

Coding:

• You should implement a subdivision scheme for closed meshes as a new function in the provided codebase. A video demonstrating the expected behaviour of the code usin one of these schemes (guess which?) is here.
• The scheme options are Loop, butterfly or Sqrt(3). The last one is the most tricky - good for those who want a challenge :).
• The Loop and butterfly formulas are found here. The Sqrt(3) algorithm is explained in details in the following paper.

Your function should take only necessary input parameters, and perform one iteration of the algorithm on the loaded mesh. The algorithm should work correctly if run multiple times. Pay attention to efficiency and robustness.

BONUS: You can get extra marks for implementing any of the following options (bonus at the discretion of the marker). For the description of each option, please refer to online literature on subdivision.

• Implement a subdivision scheme that performs correctly on meshes with boundaries.
• Implement vertex projection to the limit surface.
• Implement normal computation using the limit surface.

Inputs:

A small set of inputs to debug your algorithm can be found here. It contains coarse meshes with and without boundary. More meshes can be downloaded from Thingi10k. Please pay attention to the mesh file formats that are supported by the library that you are using. Some formats might require conversion.

Submission:

You must use the handin software to submit your assignments. First, create a UBC computer science undergraduate account by following the instructions at cs.ubc.ca/getacct. Even if your home department is not computer science, having signed up for CS524 makes you eligible to have an account. Please create an account as early as possible and do not leave it to the last minute.

Create a zip file containing the code for your assignment, and a README file containing your name and student number. Include all the code and build scripts (e.g., CMake). However, do not include any executables, build directories, or visual studio .vs folders.

After creating an account, you could use the Web Hand-in to hand-in your assignments. To access this link, you first need to login with your CWL accout. Then, you will see a large blue link saying Run Hand-In. Click on that and input Course: cs-524, Assignment name: a1. Do not forget the dash in the course name. Then uploade your .zip file.

Once you successfully hand in your assignments, you should see a message similar to the one below. This one in particular was generated by running handin using Jinfan's account.

```  yangjf> handin -p -f /tmp/EpxqzY85Lk cs-524 a1

Student user ID: yangjf
Now: Tue Sep  7 12:42:04 2021
Due: Fri Sep 24 23:59:59 2021
Blocked: Mon Sep 27 23:59:59 2021
No errors detected in compressed data of /tmp/handin.20047.zip.

Archive:  /tmp/handin.20047.zip
inflating: assn1_2021.html

Checking for TA handin script /home/c/cs-524/bin/handin ...
None ...

*** Handin process completed. ***
```

If the Web Hand-in doesn't work for you, you could use the command-line version of handin.

First, log into a department machine, either by sitting behind one physically or using ssh. Then create the folder hierarchy /your-home-folder/cs-524/a1 in your home folder. For example, using the command line your can write
```mkdir -p \${HOME}/cs-524/a1
```
Then, put the zip folder containing your assignment inside /your-home-folder/cs-524/a1. Now using the command line, change directory to your home folder.
```cd \${HOME}
```
And run the following command (pay attention to the dash in cs-524).
```handin cs-524 a1
```
Then, you must see a message similar to the one below. This one in particular was generated by running handin inside Jinfan's undergraduate account, while putting a file named my-assignment.zip inside /jinfans-home-directory/cs-524/a1/my-assignment.zip.
```Student user ID: g9j2b
Now: Tue Sep  7 13:22:04 2021
Due: Fri Sep 24 23:59:59 2021

You have passed all validation steps.

PLEASE READ THIS STATEMENT CAREFULLY AND ENSURE THAT YOU UNDERSTAND IT BEFORE
By submitting  these files, I indicate that I am fully aware of the  rules and
consequences of plagiarism, as set forth by the Department of Computer Science
and the University of British Columbia.  I hereby certify that the work in the
submitted file(s) was performed *only* by me (the owner of the account used to
submit this work), except as acknowledged in the work submitted.

Are you sure you want to continue? (y/n)  y

./
./my-assignment.zip

Checking for TA handin script /home/c/cs-524/bin/handin ...
None ...

*** Handin process completed. ***
```
You can overwrite your submission as many times as you like (as long as it is done before the deadline). To overwrite your submission with a new one, replace the zipfile inside /your-home-folder/cs-524/a1/ with the updated version and run
```handin -o cs-524 a1
```
Please do not leave submission to the last minute. Hand in the very first incomplete code that you have. Then, after every progress you make, overwrite your submission with an updated version.

All assignments should be handed in by Friday, 9/24/2021, at 23:59.

All assignments will be marked in person, using a schedule which will be published on Piazza. Please make sure to register for a marking spot. Please do not touch your code between submission deadline and marking session.

Late assignments policy: In total, you have 3 grace days for all of your assignments. You can use them whenever you want during the course.