Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yuki-koyama/elasty
A research-oriented elastic body simulator
https://github.com/yuki-koyama/elasty
elastic engine pbd physics position-based-dynamics simulation xpbd
Last synced: about 19 hours ago
JSON representation
A research-oriented elastic body simulator
- Host: GitHub
- URL: https://github.com/yuki-koyama/elasty
- Owner: yuki-koyama
- License: mit
- Created: 2019-04-03T00:35:55.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-10-14T14:20:38.000Z (over 2 years ago)
- Last Synced: 2025-01-14T02:08:01.050Z (8 days ago)
- Topics: elastic, engine, pbd, physics, position-based-dynamics, simulation, xpbd
- Language: C++
- Homepage:
- Size: 8.11 MB
- Stars: 368
- Watchers: 14
- Forks: 29
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# elasty
![macOS](https://github.com/yuki-koyama/elasty/workflows/macOS/badge.svg)
![Ubuntu](https://github.com/yuki-koyama/elasty/workflows/Ubuntu/badge.svg)
![License](https://img.shields.io/github/license/yuki-koyama/elasty)A research-oriented elastic body simulator
![](./docs/cloth.gif)
## Algorithms
### Frameworks
- [x] Position-based dynamics (PBD) [Müller+07]
- [x] Extended position-based dynamics (XPBD) [Macklin+16]
- [x] Small-steps XPBD [Macklin+19]
- [ ] Projective dynamics [Bouaziz+14]
- [ ] Quasi-Newton dynamics [Liu+17]
- [ ] ...### Update Schemes for PBD/XPBD
- [x] Gauss-Seidel update
- [ ] Jacobi update### Constraints for PBD/XPBD
- [ ] Area conservation constraint [Müller+14]
- [x] Bending constraint [Müller+07]
- [ ] Continuum-tetrahedron constraint [Bender+14]
- [x] Continuum-triangle constraint [Bender+14]
- [x] Distance constraint [Müller+07]
- [x] Environmental collision constraint
- [ ] Example-based shape matching constraint [Koyama+12]
- [x] Fixed point constraint
- [x] Isometric bending constraint [Bergou+06; Bender+14]
- [ ] Long range attachments constraint [Kim+12]
- [x] Shape matching constraint [Müller+05]
- [ ] Stable Neo-Hookean constraint [Macklin+21]
- [ ] Tetrahedron strain constraint [Müller+14]
- [ ] Triangle strain constraint [Müller+14]
- [ ] Volume conservation constraint [Müller+14]
- [ ] ...### Continuum Materials for FEM Simulation
- [x] St. Venant Kirchhoff model
- [x] Co-rotational model
- [ ] Stable Neo-Hookean model [Smith+18]
- [ ] ...## Additional Features
- Alembic export of triangle meshes
- Simple aerodynamics for clothes [Wilson+14]
- 2D FEM simulation with explicit Euler integration
- 2D FEM simulation with variational implicit Euler integration [Martin+11]
- 3D FEM simulation with variational implicit Euler integration [Martin+11]## Dependencies
### Core Library
- Alembic [BSD 3-Clause]
- Imath (3.0.2+) [BSD 3-Clause]
- Eigen [MPL2]
- tinyobjloader [MIT]### Demos
- bigger [MIT]
- bigg [Unlicense]
- bgfx.cmake [CC0]
- bgfx [BSD 2-Clause]
- bimg [BSD 2-Clause]
- bx [BSD 2-Clause]
- Dear ImGui [MIT]
- GLFW [Zlib]
- GLM [MIT]
- random-util [MIT]
- string-util [MIT]
- tinyobjloader [MIT]
- timer [MIT]
- mathtoolbox [MIT]### Tests
- googletest [BSD 3-Clause]
## Prerequisites
### macOS
```bash
brew install eigen imath
```### Ubuntu 20.04
```bash
apt install libeigen3-dev
```
and manually install Imath 3.0.2+.### Windows
(not tested yet)
## Build
```bash
git clone https://github.com/yuki-koyama/elasty.git --recursive
mkdir build
cd build
cmake ../elasty
make
```## Gallery
### PBD vs. XPBD
The constraint stiffnesses in PBD [Müller+07] are dependent on the number of iterations for constraint solving. As the number of iterations increases, the constraints become infinitely stiff regardless of the `stiffness` parameters. This issue makes the parameter tuning difficult.
XPBD [Macklin+16] resolves this issue. As the number of iterations increases, the constraint stiffnesses converge to some (non-infinitely-stiff) states in accordance with the `compliance` parameters. This property makes the parameter tuning easier and more consistent.
![](./docs/pbd-xpbd-comparison.jpg)
These simulated results were generated by `examples/pbd-xpbd-comparison/main.cpp`.
### Wind Effects for Cloth Simulation
This library supports wind effects for cloth simulation. This library calculates aerodynamic "drag" and "lift" forces based on the model used in Disney's Frozen [Wilson+14].
![](./docs/wind.jpg)
This simulated result was generated by `examples/aerodynamics/main.cpp`.
### Finite Element Methods
This library offers some utility functions to implement the finite element method (FEM) and simple examples of such implementations.
![](./docs/fem-2d.gif)
![](./docs/fem-3d.gif)These simulated results were generated by `examples/variational-implicit-2d/main.cpp` and `examples/variational-implicit-3d/main.cpp`, respectively, which use the variational implicit Euler method [Martin+11] and the co-rotational model.
## License
MIT License
## Contributing
Issue reports and pull requests are highly welcomed.
## References
- __[Bender+14]__ Jan Bender, Dan Koschier, Patrick Charrier, and Daniel Weber. 2014. Position-based simulation of continuous materials. Comput. Graph. 44 (2014), 1-10. DOI: http://doi.org/10.1016/j.cag.2014.07.004
- __[Bender+17]__ Jan Bender, Matthias Müller, and Miles Macklin. 2017. A survey on position based dynamics, 2017. In Proc. Eurographics '17 Tutorials, Article 6, 31 pages. DOI: https://doi.org/10.2312/egt.20171034
- __[Bergou+06]__ Miklos Bergou, Max Wardetzky, David Harmon, Denis Zorin, and Eitan Grinspun. 2006. A quadratic bending model for inextensible surfaces. In Proc. SGP '06, 227--230. DOI: https://doi.org/10.2312/SGP/SGP06/227-230
- __[Bouaziz+14]__ Sofien Bouaziz, Sebastian Martin, Tiantian Liu, Ladislav Kavan, and Mark Pauly. 2014. Projective dynamics: fusing constraint projections for fast simulation. ACM Trans. Graph. 33, 4 (2014), 154:1--154:11. DOI: https://doi.org/10.1145/2601097.2601116
- __[Kim+12]__ Tae-Yong Kim, Nuttapong Chentanez, and Matthias Müller-Fischer. 2012. Long range attachments: a method to simulate inextensible clothing in computer games. In Proc. SCA '12, 305--310. DOI: https://doi.org/10.2312/SCA/SCA12/305-310
- __[Koyama+12]__ Yuki Koyama, Kenshi Takayama, Nobuyuki Umetani, and Takeo Igarashi. 2012. Real-time example-based elastic deformation. In Proc. SCA '12, 19-24. DOI: https://doi.org/10.2312/SCA/SCA12/019-024
- __[Liu+17]__ Tiantian Liu, Sofien Bouaziz, and Ladislav Kavan. 2017. Quasi-Newton methods for real-time simulation of hyperelastic materials. ACM Trans. Graph. 36, 3 (2017), 23:1--23:16. DOI: https://doi.org/10.1145/2990496
- __[Macklin+16]__ Miles Macklin, Matthias Müller, and Nuttapong Chentanez. 2016. XPBD: position-based simulation of compliant constrained dynamics. In Proc. MIG '16, 49-54. DOI: https://doi.org/10.1145/2994258.2994272
- __[Macklin+19]__ Miles Macklin, Kier Storey, Michelle Lu, Pierre Terdiman, Nuttapong Chentanez, Stefan Jeschke, and Matthias Müller. 2019. Small steps in physics simulation. In Proc. SCA '19, 2:1–2:7. DOI: https://doi.org/10.1145/3309486.3340247
- __[Macklin+21]__ Miles Macklin and Matthias Muller. 2021. A constraint-based formulation of stable Neo-Hookean materials. In Proc. MIG '21, 12:1–12:7. DOI: https://doi.org/10.1145/3487983.3488289
- __[Martin+11]__ Sebastian Martin, Bernhard Thomaszewski, Eitan Grinspun, and Markus Gross. 2011. Example-based elastic materials. ACM Trans. Graph. 30, 4, 72:1--72:8 (July 2011). DOI: https://doi.org/10.1145/2010324.1964967
- __[Müller+05]__ Matthias Müller, Bruno Heidelberger, Matthias Teschner, and Markus Gross. 2005. Meshless deformations based on shape matching. ACM Trans. Graph. 24, 3 (2005), 471-478. DOI: https://doi.org/10.1145/1073204.1073216
- __[Müller+07]__ Matthias Müller, Bruno Heidelberger, Marcus Hennix, and John Ratcliff. 2007. Position based dynamics. J. Vis. Comun. Image Represent. 18, 2 (2007), 109-118. DOI: https://doi.org/10.1016/j.jvcir.2007.01.005
- __[Smith+18]__ Breannan Smith, Fernando De Goes, and Theodore Kim. 2018. Stable Neo-Hookean Flesh Simulation. ACM Trans. Graph. 37, 2, 12:1-12:15 (July 2018). DOI: https://doi.org/10.1145/3180491
- __[Umetani+14]__ Nobuyuki Umetani, Ryan Schmidt, and Jos Stam. 2014. Position-based elastic rods. In Proc. SCA '14, 21-30. DOI: https://doi.org/10.2312/sca.20141119
- __[Wilson+14]__ Keith Wilson, Aleka McAdams, Hubert Leo, and Maryann Simmons. 2014. Simulating wind effects on cloth and hair in Disney’s Frozen. In ACM SIGGRAPH 2014 Talks, 48:1. DOI: https://doi.org/10.1145/2614106.2614120
- (TODO)