Open Source library for tracking objects on terrain fluid flows
- Python
- ReactPhysics3D C++ Library
- Blender (for running the fluid simulation and visualizing the results)
git clone https://github.com/hugoaboud/fluidtrack
cd fluidtrack
make
-
Open Blender simulation at sim/@/@.blend
-
Run the parse_cache script (more info below) to generate the .flow file
python3.5 scripts/parse_cache.py sim/brumadinho/cache_fluid/ sim/brumadinho/fluid.flow 50 [0,0,0.203386] [19,18.5,3]
- Run fluidtrack passing the desired config json as argument
./fluidtrack sim/brumadinho/config.json
- To visualize the results, select the Object on Blender and run Blender script import_anim to create position/orientation keyframes:
Parse the Blender fluid simulation info from the "sim/@/cache_fluid" folder into a single .flow file. Arguments:
- cache folder
- output file
- animation length (seconds, from Blender fluid simulation Time)
- position array (from Blender Object transform)
- scale array (from Blender Object transform) Example:
python3.5 scripts/parse_cache.py sim/brumadinho/cache_fluid/ sim/brumadinho/fluid.flow 50 [0,0,0.203386] [19,18.5,3]
Blender script for exporting the selected mesh as a .csv file containing the vertex position.
Blender script for importing a .csv file containing coordinates to animate the position and rotation of the selected object.