Skip to content

j3soon/newton-ice-cream

Repository files navigation

Newton Ice Cream

Simulate ice cream in Newton with MPM.

As shown in the preview videos below, the current result is a material that kind of looks like ice cream, but it's not quite there yet. Planning to further tune the material parameters and document their effects in the near future (hopefully).

Set up

Clone the repository:

git clone --recursive https://github.com/j3soon/newton-ice-cream.git
cd newton-ice-cream

Set up virtual environment and install dependencies:

uv venv --python 3.12
source .venv/bin/activate
uv pip install -e "./newton[examples]"

Run Example

Scooping Ice Cream

source .venv/bin/activate
python ./example_mpm_ice_cream_spoon.py
python ./example_mpm_ice_cream_spoon.py --voxel-size 0.005
ice_cream_spoon.mp4
ice_cream_spoon_voxel-size-0.005.mp4

written with minimal diff:

diff ./example_mpm_viscous.py ./example_mpm_ice_cream_spoon.py
code -d ./example_mpm_viscous.py ./example_mpm_ice_cream_spoon.py

Flour on Spoon

source .venv/bin/activate
python ./example_mpm_granular_spoon.py
granular_spoon.mp4

written with minimal diff:

diff ./example_mpm_granular.py ./example_mpm_granular_spoon.py
code -d ./example_mpm_granular.py ./example_mpm_granular_spoon.py

Assets

assets/teaspoon is created from Blender Extra Mesh Objects extension, with configs Max Resolution: 15, and applied Recalculate Normals afterwards. The object/mesh is also renamed to Tea Spoon. More details at: https://projects.blender.org/blender/blender/issues/158101

Appendix

Run Newton built-in examples

python -m newton.examples mpm_viscous
python -m newton.examples mpm_granular

Choice of Simulation Engine

Newton MPM is a promising approach for simulating complex fluids and materials that are difficult to model with existing physics simulators. For example, Omniverse/Isaac Sim/Isaac Lab with the PhysX backend can simulate soft bodies and particle-based fluids, but it remains challenging to simulate materials that fall in-between these two categories, such as ice cream. See related discussions here: isaac-sim/IsaacLab#2953

About

Simulate ice cream in Newton with MPM.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages