This is a final project of CS180, an undergraduate-level Computer Graphics course taught by a talented genius Professor Lingqi Yan at University of California, Santa Barbara.
This project has a python sibling: minimal-FEM-simulation, which served as a prototype for validating the correctness of algorithm implementation, mainly developed by Petry Ye who is an undergraduate student major in CCS computing at UCSB.
- In the root directory where a Makefile exists, compile with
$ make all.
- Run the program with
$ ./main <path_to_obj_file>.
- For example,
$ ./main models/unit_cube.obj.
- There are currently two sample obj files, one unit cube and one rounded star, in models/ directory. After running the program, the output obj files will be in the /out folder.
- You can clean the project with
$ make clean.
There are several parameters defined in formula.cpp and main.cpp. For example:
#define N_STEPS 3000 // number of iterations
#define stepPerFrame 20
These two parameters can significantly impact the running time of the program. You are free to change the parameters and play with them. However, we strongly recommend that you don't change
#define DELTA_TIME 0.2
#define MASS 20.0
defined in formula.cpp. We made a lot of effort trying to find these parameters that fit the models we use under models.
-
Sifakis, Eftychios D. “FEM Simulation of 3D Deformable Solids: A practitioner’s guide to theory, discretization and model reduction. Part One: The classical FEM method and discretization methodology.”
-
Si, Hang. “TetGen, a Delaunay-Based Quality Tetrahedral Mesh Generator”, ACM Transactions on Mathematical Software, February 2015
This project is under GPL 3.0 License.
Simply copying & pasting and using it as your own course project would cause serious issues of academic integrity.