This repository provides a simulator for fossilization and deformation of 3D models and fragments, built on a PyTorch implementation of the Moving Least Squares Material Point Method (MLS-MPM). It enables physically-based deformation of single objects and fragmented products, supporting research in paleontology, computer graphics, and physics-based modeling.
- Deform single 3D models or fragmented products using MLS-MPM
- GPU-accelerated simulation via PyTorch and CUDA
- Support for mesh downsampling, grid resolution control, and animation output
- Tools for fragment jiggling and random rotation
- Example configs and datasets for quick start
-
Install Conda environment using the provided
environment.yml:conda env create -f environment.yml conda activate mpmpytorch_deform
-
Install CUDA according to your device. The simulator is tested with CUDA 12.9.
- Use PyTorch wheels built with CUDA 12.9 (please help yourself if your driver supports a different CUDA level):
pip install torch torchvision open3d --extra-index-url=https://download.pytorch.org/whl/cu129
- Use PyTorch wheels built with CUDA 12.9 (please help yourself if your driver supports a different CUDA level):
-
Download example datasets:
- deform_example_fragments and deform_example_individual
- These folders demonstrate deformation of single products and fragmented products.
- Deform a single product:
python main.py --json examples/deform_example_individual/deform.json
- Deform fragmented products:
python main.py --json examples/deform_example_fragments/deform_fragments.json --fragment_model
- The output path is specified by
save_folderin the JSON config.
model_path: Path to the model (folder for fragments, mesh OBJ for single product)save_folder: Output directory for resultsface_limitation: Number of faces to downsample mesh togrid_res: Grid resolution for MPM points (e.g., 100)animate_info.gif_save_dir: Path to save animation GIFsample_rate: Frame sampling rate for GIF outputforce_info.major_force.region_proj_direction: Specifies the direction of the major force vector. By default, force direction is randomized. To align with a specific direction (e.g., from fractureBEM), configure as follows:json "major_force" : { "radius" : 0.2, "force_magnitude" : 0.8, "disk_shift" : 0.1, "region_proj_direction" : [2, 3, 2] }Important: When aligning with fossilization_simulator_frBEM force direction, use the opposite direction vector. For example, if fractureBEM uses0 0 1, set this parameter to[0, 0, -1].
Most other parameters relate to MPM simulation and typically do not need modification.
Note: The fragments in
deform_example_fragmentsare generated by fossilization_simulator_frBEM. The required fragments are in the_viewfolder; please ignore other verbose documents.
tools/jiggling.py: Randomly rotate and jiggle fragments (useful for frBEM fragment results before deformation).
If you use this simulator, please cite this. MPM-pytorch package is developed by them:
@inproceedings{
lin2025omniphysgs,
title={OmniPhys{GS}: 3D Constitutive Gaussians for General Physics-Based Dynamics Generation},
author={Yuchen Lin and Chenguo Lin and Jianjin Xu and Yadong MU},
booktitle={The Thirteenth International Conference on Learning Representations},
year={2025},
}
And related works on MLS-MPM.
MIT License. See libs/MPM-PyTorch/LICENSE for details.
For questions or issues, please contact: cx2219@nyu.edu