This is a Unity based MPM simulation. MPM stands for Material Point Method, which is an algorithm that can simulate continuum materials like solids and liquids. In this case, it is used to simulate skin deformation and cutting, for applications in skin surgery. For more information on MPM, check Wikipedia.
So far this program can simulate up to 100,000 particles at around 40fps by taking advantage of the Unity Job System (for multithreading) and Burst Compiler (for efficient compiling). There is a laser that can cut into the material, and you can make the laser follow a bezier curve by editing the bezier curve handles. Here are a few gifs showing operation.
The main branch has not been updated for a while, since it started off as a 2D MPM simulation. For latest updates, please look into the 3D branch.
This simulation runs on Unity 2020.3.14f1. It probably works on older versions and newer versions, but we can't guarantee that it'll work.
Begin by installing the project's unity version. Other versions may or may not work.
If not already installed, install git.
Clone the repository to your local machine
git clone https://github.com/EsteBran/SkinFlapSimulation.git
Move into the simulation directory and checkout the 3D branch
cd SkinFlapSimulation
git checkout 3D
Open Unity Hub, and click on ADD. Navigate to where you cloned the SkinFlapSimulation repo and click "Select Folder"
When you first open the project, you'll have a random "New Scene" open in the editor. Navigate to the Assets folder and open "SampleScene" (not a very good name, we know) and open the scene by double clicking on it.
To run the simulation, click on the play button at the top of the scene window.
Q: Toggles camera control on and off
When camera is enabled: Mouse to look, WASD to move, SPACE to move vertically up, LShift to move vertically down.
Since automatic laser movement is not yet implemented, move the laser by maniupalting the position values in the inspector window.
-
Refactor program into a more modular version in order to be able to add more features
-
- Make it use 3D coordinates instead of 2D
-
Interacting between mesh and particles
-
Be able to import custom objects/meshes (obj files)
-
Maybe using unity particle system
-
Move simulation into 3D (might have to start with 3D depending on what we want to do)
-
Use shaders to parallelize simulation
-
Cut with laser and then maybe knife
-
Figure out global position of particle
-
Cut objects into smaller objects and have them interact with one another real time
-
Mouse interaction
-
Better mouse interaction or cut with laser?
-
Use knife to cut (probably use particles) using predetermined paths?
-
- Probably need to create a system that simulates multiple objects
-
Try it out in 3D (have an idea of how much work we need to do)
-
Refactor program into something more modular