For this assignment, you will be implementing two algorithms covering: 1. Loop Subdivision 2. Quadratic Error Mesh Decimation over any 3D object.
We have made available a visualization tool using the Three.js library implemented in "./js/assignment1.js" and an example implementation located in "./assignments/assignment1.py". Your objective is to create implementations for both "subdivision_loop" and "simplify_quadric_error". You are encouraged to use a programming language with which you are comfortable. The output results should be in the obj format, and you must visualize your outcomes accordingly.My Loop subdivision algorithm consists of the following broad steps:
Please refer to the code comments for more details about the implementation of the individual steps.
For my particular implementation, I use dictionaries extensively. I use dictionaries keyed by the edges (a tuple of vertex indices) to map the edges to the odd vertices that were generated using it. I use a dictionary to map the original vertices in the mesh that are used to generate the even vertices. I use a dictionary to index the newly generated vertices to an index for fast lookup when creating new faces.
Most of my processing is done by iterating over faces and sometimes vertices.
My implementation takes kess than a minute to run for less than three iterations and about 4 minutes on my computer to run for 5 iterations.
Quadratic Error involves a three-step process:
Please refer to the code comments for more details about the implementation of the individual steps.
Most of my processing is done by iterating over faces and sometimes vertices.
Here also, I use dictionaries extensively. I use dictionaries keyed by the vertices (index of vertex in original mesh) and edges (a tuple of vertex indices) to store the quardric matrices. I loop over the edge quadrics dictionary to find the minimum cost edge to collapse. For collapsing the edges, I essentially create a new list of vertices using the old list and create new faces using the new vertex indices. I use a dictionary here as well to accelerate lookup of indices fo vertices.
My implementation takes kess than a minute to run for less than three iterations and about 4 minutes on my computer to run for 5 iterations.