Home

Awesome

FleX Bindings for Python: pyFleX 0.1

Currently, the bindings here are just used to run the FleX demo. I have only uploaded the boilerplate code that lets you initialize the simulator with a single wrapper, update the frame, and send and receive variables in python. For example, there is a function that grabs particle positions. The python binding bindings.grab_x_pos_particle(i) allows you to grab the x position of any particle in the scene. An example for sending variables to C++ is that you can add variables to the void initialize() function in bindings/main_python.cpp and pass directly from python.

The bulk of my work on these bindings was to link the libraries from FleX and CUDA to pybind11 in CMake files and integrate a setup.py file that lets you easily install the bindings with pip. It took me a while; hopefully it will save you time for creating more bindings as you need. I may or may not create a more general purpose set of bindings. See the README.md in the subfolder 'bindings' for more details.

Citation: <br> @misc{clever2018pyflex,<br> author = {Henry M. Clever}, <br> title = {pyFleX 0.1: High Level Python Bindings for FleX}, <br> year = {2018}, <br> publisher = {GitHub}, <br> journal = {GitHub repository}, <br> howpublished = {\url{https://github.com/henryclever/FleX_PyBind11}", <br> }

NVIDIA Flex - 1.2.0

Flex is a particle-based simulation library designed for real-time applications. Please see the programmer's manual included in this release package for more information on the solver API and usage.

Supported Platforms

Requirements

A D3D11 capable graphics card with the following driver versions:

To build the demo at least one of the following is required:

And either:

Demo

Use the run_cuda.bat or run_d3d.bat files to launch the demo.

Notes

Command Line Options

The following commands may be passed to the demo application to modify behavior:

-fullscreen=wxh  Start fullscreen e.g.: -fullscreen=1280x720
-msaa=0          Disable multisampling (default is on)
-device=n        Choose GPU to run on
-d3d12           Enable D3D12 compute
-benchmark       Enable bencmark mode, will write a benchmark.txt to the root folder
-vsync=0         Disable vsync

Controls

w,s,a,d - Fly Camera
right mouse - Mouse look
shift + left mouse - Particle select and drag

p - Pause/Unpause
o - Step
h - Hide/Show onscreen help

left/right arrow keys - Move to prev/next scene
up/down arrow keys - Select next scene
enter - Launch selected scene
r - Reset current scene

e - Draw fluid surface
v - Draw points
f - Draw springs
i - Draw diffuse
m - Draw meshes

space - Toggle fluid emitter
y - Toggle wave pool
c - Toggle video capture
u - Toggle fullscreen
j - Wind gust
- - Remove a plane
esc - Quit

Known Issues

Acknowledgements