As the title implies, I’ve just finished the alpha release of RhinoPhysX. The goal here is to implement a nice, easy to use, physics engine in Rhino. There are of course other (very awesome) physics plugins, but none of them specialize in the standard physics simulations: rigid bodies, cloth, and particles (fluids). Fortunately, PhysX has just released version 3.3 of their SDK – which does all these things! And (new to this release) lets all the different actors in physics scene react to each other (note: there are some limitations).
A huge shout out should go to the great folks at Physxdotnet! RhinoPhysX relies heavily on their wrapper to get PhysX working nicely with RhinoCommon. I did have to make quite a few changes to Physxdotnet to get everything up and running with Physx 3.3 – and actually I think a more targeted wrapper for RhinoCommon is probably needed for future releases. However, Physxdotnet is great.
NOTE: This is an alpha release! Expect some strange crashes and weird behaviour – use at your own risk. Oh, and it’s 64 bit only. You also need the VS2012 Redistributable.
Here are some videos:
- Fully integrated with the Rhino environment – simulation loop and setup is done behind the scenes.
- Box, Sphere, and Convex rigid body simulation
- Triangle mesh rigid static simulation.
- Interact with the physics simulation with Kinematic actors
- Cloth interacts with all scene geometry (note: try to avoid convex colliders and cloth interaction – it will most likely crash Rhino)
- GPU Fluids!
- Collision enabled Joints.
There are a ton of settings that I haven’t yet exposed with RhinoPhysx – currently, the focus is on ease of use. To install, just double click the RHP file (the little Rhino icon) after extracting.
Before you can do anything else, you must initialize the physics scene:
- rpInitialize – This will create a new scene and erase any previous simulation data.
Then, add some actors:
- rpRigidDynamicActor – Use the collider options to select the kind of rigidbody you want (convex is the slowest).
- rpRigidStaticActor – You can use this to add any arbitrary triangle mesh to the simulation. Please make sure the vertices are unique and welded! Also, make sure the normals are facing the right way.
- rpClothActor – The “stiffness” setting is probably the most interesting.
- rpFluidActor – Select a box to defined where the fluid emits from. The settings are a bit delicate – the most important being the rest distance. Make sure it is something reasonable.
- rpJoint – Select two or more rigid bodies to create a joint. Setting these up is a bit tricky, so they might not work as expect in this release.
- rpRemoveActor – Select some actors to remove.
Then, start simulating:
- rpSimulate – starts the simulation
- “Esc” will pause/unpause the simulation
If you want to start over, use just call rpInitialize again. You can also interact with the rigid bodies of the scene:
- rpInteract – click and drag on a rigid body (only rigid bodies work!) to move it around. Hit Esc to leave this mode.