Edwardong / Minimal-FEM-CPP

A Simulation of Deformation And Movement of A 3D Object Using The Finite Element Method

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Minimal-FEM-CPP

License: GPL v3

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.

Usage

Code Compilation

  • 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.

Reference:

NOTICE regarding academic integrity:

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.

About

A Simulation of Deformation And Movement of A 3D Object Using The Finite Element Method

License:GNU General Public License v3.0


Languages

Language:C++ 99.8%Language:Makefile 0.2%Language:CMake 0.0%