I missed a few submissions of earlier assignments due to people using a different subject – I think I’ve found all of the submissions, but it’s entirely possible that I’m still missing some. As far as I know, I have finished grading assignments 0-4. If you submitted any of those assignments but haven’t received a grade, please let me know. If you need to get in touch with me, it will probably be easier for you to email me at mgillesp@andrew.cmu.edu. The DDG class email inbox is always full of assignments/readings, so it’s easy for me to miss things.

]]>**Warning:** You *cannot* use late days on this assignment since it’s the last one.

In this assignment, you will investigate tools for working with tangent vector fields on surfaces. Tangent vector fields are central to classical differential geometry, and have many interesting applications. For this homework, we’ll look at one algorithm for designing vector fields, and along the way we’ll cover a lot of deep facts about surfaces.

There’s no PDF this week since the exercises are all from the notes.

Do any **12** of Exercise 8.1 – Exercise 8.21 in the notes, except for Exercise 8.13.

**Submission Instructions.** Please submit your solutions to the exercises (whether handwritten, LaTeX, etc.) as a single PDF file by email to Geometry.Collective@gmail.com. *This email must also contain the .zip file for your coding solution*. Scanned images/photographs can be converted to a PDF using applications like Preview (on Mac) or a variety of free websites (e.g., http://imagetopdf.com). Your submission email must include the string **DDG19A6** in the subject line.

**Warning:** You *cannot* use late days on this assignment since it’s the last one.

**Warning:** You *cannot* use late days on this assignment since it’s the last one.

Please implement the following routines in:

`projects/vector-field-decomposition/tree-cotree.js`:`buildPrimalSpanningTree``inPrimalSpanningTree``buildDualSpanningCotree``inDualSpanningCotree``buildGenerators`

`projects/vector-field-decomposition/harmonic-bases.js`:`buildClosedPrimalOneForm``compute`

In addition, please implement **either** Hodge Decomposition, or Trivial Connections (on surfaces of genus 0):

**Hodge Decomposition**: Please implement the following routines in

`projects/vector-field-decomposition/hodge-decomposition.js`:`constructor``computeExactComponent``computeCoExactComponent``computeHarmonicComponent`

**Trivial Connections on Surfaces of Genus 0:** Please implement `computeConnections` in `projects/direction-field-design/trivial-connections.js`. This file has function signatures for trivial connections on arbitrary surfaces, but for this assignment we are only requiring you to compute the connection form on simply-connected surfaces where you don’t have to worry about the *period matrix*. You are, of course, welcome to implement the general algorithm if you would like to!

**Notes:**

- I made some changes to the tests for this assignment, and to the trivial connections viewer. You should update the following files before starting the assignment:
`tests/vector-field-decomposition/test.html``tests/vector-field-decomposition/test.js``tests/direction-field-design/sphere.js``tests/direction-field-design/test.html``tests/direction-field-design/test.js``projects/direction-field-design/index.html`

- Recall that
*homology generators*are a set of loops which somehow describe all of the interesting loops on a surface. For example, here are the two homology generators for the torus. - Your
`buildGenerators`function should implement the*Tree-Cotree*algorithm, which is Algorithm 5 of section 8.2 of the notes. - In
`tree-cotree.js`the trees are stored using the dictionaries`vertexParent`and`faceParent`. You should store the primal spanning tree by storing the parent of vertex`v`in`vertexParent[v]`. The root should be its own parent. Similarly, you should store the dual spanning cotree by storing the parent of face`f`in`faceParent[f]`. - The Tree Cotree algorithm finds homology generators on the
*dual mesh*. That is to say, you should take each*dual edge*which is not in either spanning tree, and form a loop by following its endpoint back up the dual cotree until they meet at the root of the dual cotree. Even though we’re thinking of these homology generators as loops on the dual mesh, we still store them as lists of ordinary halfedges, since edges in the dual mesh are in 1-1 correspondence with edges in the primal graph. `buildClosedPrimalOneForm`should use a homology generator to construct a closed primal 1-form as described in section 8.22 of the notes.- The
`compute`function in`HarmonicBases`should compute a harmonic basis using Algorithm 6 in section 8.2 of the notes. If you choose to implement Hodge decomposition for the assignment, you are welcome to use your Hodge decomposition code to solve for $d\alpha$. Otherwise, you can just ignore the`hodgeDecomposition`parameter and directly solve the linear system $\Delta \alpha = \delta \omega$ to find $\alpha$. (Recall that $\delta$ is the*codifferential*, which we talked a lot about in the Discrete Exterior Calculus assignment).

**Notes (Hodge Decomposition):**

- The procedure for Hodge Decomposition is given as Algorithm 3 in section 8.1 of the Notes.
- Note that the
`SparseMatrix`class has an`invertDiagonal`function that you can use to invert diagonal matrices. - For
`computeCoExactComponent`, you should compute the coexact component $\delta \beta$ of a differential form $\omega$ by solving the equation $d\delta \beta = d\omega$. As stated in the notes, the most convenient way of doing this is to define a dual 0-form $\tilde \beta := *\beta$, and then to solve $d*d \tilde \beta = d \omega$. Then you can compute $\delta \beta$ using the fact that $\delta \beta = *d*\beta = *d\tilde\beta$. When doing these computations, you should keep tract of whether your forms are primal forms or dual forms, recalling that hodge stars take you from primal forms to dual forms, and hodge star inverses take you from dual forms to primal forms. (THis is discussed in detail in section 8.1.3 of the notes. - Note that the 2-form Laplacian
`B`is not necessarily positive definite, so you should use an LU solver instead of a Cholesky solver when solving systems involving`B`.

**Notes (Trivial Connections):**

- The
`trivial-connection-js`file is structured for implementing the full trivial connections algorithm on arbitrary surfaces. Since that’s tricky, we’re only requiring that you compute connections on topological spheres. You should implement this in the`computeConnections()`function, and it should pass the tests labeled “computeConnections on a sphere”. - Even though we’re working with spheres, it is still helpful to use the formulation of Trivial connections given in section 8.4.1 of the notes. In particular, you should solve the optimization problem given in Exercise 8.21.
- On a sphere, there are no harmonic 1-forms, so the $\gamma$ part of your Hodge decomposition will always be 0. Furthermore, the sphere has no homology generators, so the problem simplifies to \[\min_{\delta \beta} \;\|\delta\beta\|^2\;\text{s.t.}\; d\delta\beta = u\]
- Following the notes, we observe that the constraint $d\delta\beta = u$ determines $\beta$ up to a constant, and that constant is annihilated by $\delta$. So you can find the connection 1-form $\delta \beta$ with a single linear solve.

**Submission Instructions**

Please rename all `js` files you edited to be `txt` files and put them in a **single zip file** called solution.zip. This file **and** your solution to the written exercises should be submitted together in a **single email** to Geometry.Collective@gmail.com with the subject line **DDG19A6**.

**Warning:** You *cannot* use late days on this assignment since it’s the last one.

Your main references for this assignment will be:

- this video, which gives a brief (18-minute) overview of the algorithm, and
- this paper, which explains the algorithm in detail.

Written exercises for this assignment are found below.

For the coding portion of this assignment, you will implement the *heat method*, which is an algorithm for computing geodesic distance on curved surfaces. All of the details you need for implementation are described in Section 3 of the paper, up through and including Section 3.2. Note that you need only be concerned with the case of **triangle meshes** (not polygon meshes or point clouds); pay close attention to the paragraph labeled “Choice of Timestep.”

Please implement the following routines in:

`projects/geodesic-distances/heat-method.js`:`constructor``computeVectorField``computeDivergence``compute`

**Notes**

- Refer to sections 3.2 of the paper for discretizations of Algorithm 1 (page 3).
- Recall that our Laplace matrix is
*positive*semidefinite, which might differ from the sign convention the authors use. - The tests for
`computeVectorField`and`computeDivergence`depend on the`A`and`F`matrices you define in your constructor. So if you fail the tests but your functions look correct, check whether you have defined the flow and laplace matrices properly. - Your solution should implement zero neumann boundary conditions (which are the “default behavior” of the cotan Laplacian) but feel free to tryout other Dirichlet and Neumann boundary conditions on your own.

**Submission Instructions**

Please rename your `heat-method.js` file to `heat-method.txt` and put it in a **single zip file** called solution.zip. This file **and** your solution to the written exercises should be submitted together in a **single email** to Geometry.Collective@gmail.com with the subject line **DDG19A4**.

For your assignment you will need to read the Overview (1.1) and Preliminaries (1.2); you must also pick one of Part I, Part II, or Part III to read, each of which covers a different perspective on discrete conformal maps. The most interesting subject, perhaps, is the connections to hyperbolic geometry in Part IV, which you can read for your own enjoyment!

Hand-in instructions are, as usual, found on the assignments page. The reading is due at **10 AM Eastern, before lecture on April 18, 2019**.

]]>

You can find a demo of the different Euler integrators applied to a pendulum here, and you can find a demo of how they flow particles on phase space here.
]]>

The written part of your next assignment, on conformal surface flattening, is now available below. Conformal flattening is important for (among other things) making the connection between processing of 3D surfaces, and existing fast algorithms for 2D image processing. You’ll have the opportunity to implement one of these algorithms in the coding part of the assignment.