Due Friday, December 13.
03 Practical Implementation in Houdini
Discrete Exterior Calculus Implementation for Heat Flow
Download the .hip file for this Homework from the download section here.
Your job will be to build the basic DEC operators $d$ and $\star$ to then build the 0-form Laplacian for a heat flow simulation. You will need SciPy for this which was discussed in the previous tutorials.
The test subject will be an innocent bunny. We will touch the nose of the bunny with a crazy hot needle and see how the heat distributes on the innocent bunny’s skin/surface. The nose is the most sensitive body part of the bunny.
Comment your code and submit your .hipnc file and a video. Read the notes at the end of this page.
- Point weight ( 2pts. )
Compute the point weights (area of the dual point). Call the point attribute f@point_weight. Hint: use the measure node to compute triangle areas and use attribute promote node to make the point weight computation easier.
- Edge weights ( 3pts. )
Compute the edge weights and dual-edge weights. (Dual edge weight: sum of adjacent triangle barycenter distances to edge midpoint). This should be stored on vertices and called f@edge_weight, f@dual_edge_weight.
- DEC build ( 8pts. )
After the previous node, a polyline structure is build of the mesh (one line segment for each half-edge, all vertex attributes are transferred to the polylines). Use the given polyline structure of the mesh to build the sparse discrete exterior calculus matrices of $\star_0, \star_1, d_0$ by importing the necessary information from attributes.
- Laplace build ( 1pt. )
Build L = \star d \star and make sure that all the matrices are cached-in correctly so that the heat flow python node further below can find these matrices.
- Color up ( 2pts. )
Figure out a nice way to color the heat on the bunny using the computed heat values.
If done well, you will now see the heat move as in the gif above.
- More heat ( 2pts. )
A small modification of the code can simulate the following: place a hot needle on the bunny’s nose and keep the needle there, thus heating up the bunny further. This is what the result should look like.
- Render it ( 2pt. )
Grab some textures and build a nice floor (https://texturehaven.com/) with diffusion, normal, displacements, roughness texture. Set up some environmental light (https://hdrihaven.com/). Make a mini-video of this scene and play with the camera position. Be creative, make it dramatic!
Note: Heat flow is a simulation of diffusion.
Note: Congratulations. You now have the basic building block operators that can be applied in SO many algorithms.
Note: Use the geometry spreadsheet to check if your edge weights make sense.
Note: Use the Houdini python shell with “print” command to debug python code.
Note: When you open the file your python will have error messages because certain attributes don’t yet exist.
Note: For the DEC task, you actually don’t need that much extra code, you really just have to know what attributes to import for connectivity, how to use numpy.arange(), numpy.append(), and numpy.ones().
Note: This task is though, but you have all the tools you need for it.
Note: Come to my office MA823 if you are about to give up.
Note: I think it is really impressive how the heat flow looks so smooth but the mesh is so rough. DEC is really powerful.
Note: Secret hint: you can take any video and export it as a sequence of enumerated images (e.g. imagename_0001.png, …). You can then import these images as a sequence of textures. This means that you can use a video of textures. You can even do this for environmental maps (360 degree videos).
Note: Notice how cool the laplacian building was. We only used intrinsic data and build simple matrices which multiplied together gave us a really complicated operator.
Note: If your heat flow does not exactly look like in the gifs above then maybe it is because you chose a different coloring method.
Note: Sorry for the many notes.
Total: 20 pts.