For the coding portion of your first assignment, you will implement some operations on simplicial complexes which were discussed in class and in Chapter 2 of the course notes. Once implemented, you will be able to select simplices and apply these operations to them by clicking the appropriate buttons in the viewer (shown above).
Getting Started
- Decide whether you want to use the web skeleton (in JavaScript) or the desktop skeleton (in C++). The web skeleton should “just work” for anyone with a web browser. Setting up the C++ skeleton is also fairly automatic (just a few git commands), but requires a little more familiarity with coding environments. (The benefit of the C++ version is that it’s built on a richer, real-world mesh processing/visualization library than the web version.)
- To use the JavaScript version, download or clone the files in the ddg-exercises-js repository.
- To use the C++ version, follow the instructions in the ddg-exercises repository. It is important that you follow the “Getting Started” instructions and do not simply git clone the repo. Otherwise, dependencies will not be installed correctly, and the code will not build. If you struggle to get the C++ version working on your platform, we recommend you switch to the JavaScript version.
- Either way, you should need to download just one code skeleton for the whole semester (though we may push periodic updates to fix bugs, etc.).
- For this assignment, you will need to implement the following routines in projects/simplicial-complex-operators/simplicial-complex-operators.[js|cpp]:
- assignElementIndices
- buildVertexEdgeAdjacencyMatrix
- buildEdgeFaceAdjacencyMatrix
- buildVertexVector
- buildEdgeVector
- buildFaceVector
- star
- closure
- link
- isComplex
- isPureComplex
- boundary
Notes
- The JavaScript assignment comes with a viewer projects/simplicial-complex-operators/index.html which lets you apply your operators to simplices of meshes and visualize the results. Likewise, the C++ version comes with a viewer with similar functionality. (Viewers will be available for all assignments throughout the semester.)
- Pay close attention to the course notes! Some routines really must be implemented with sparse matrices, not directly with the halfedge mesh data structure.
- Selecting simplices will not work until you fill in the assignElementIndices function.
- The assignment also comes with a test script tests/simplicial-complex-operators/text.html which you can use to verify the correctness of your operators.
- The web framework is implemented in Javascript, which means no compilation or installation is necessary on any platform. You can simply get started by opening the index.html file in projects/discrete-exterior-calculus/ in a web browser. We recommend using Chrome or Firefox. Safari has poor WebGL performance.
- If you do not have prior experience with Javascript, do not worry! You should be able to get a handle on Javascript syntax by reading through some of the code in the framework (a good place to start might be core/geometry.js). The framework also contains extensive documentation (see docs/index.html).
- All browsers come with tools for debugging (for instance the JavaScript Console in Chrome).
Submission Instructions
The assignment is due on February 26, 2020 at 5:59:59pm Eastern (not at midnight!). Remember to turn in the whole coding assignment via a single ZIP file containing the modified source files. Further hand-in instructions can be found on this page.