I am new to Processing. I think Haven’t used it for a while. What is the good and fast mesh manipulation library nowadays? Which is steel in active development.
I remember ToxicLib was amazing, but it haven’t been updated for ages.
Basically I need a mesh Lib with some basic physics simulation potentially. Say for creating origami shapes and flat panels.
If your meshes are complex and you need to do a lot of specific operations (split face, get vertices in sorted order, get neighbors in CCW-order, smooth, …), I would suggest HE_Mesh but the library doesn’t come with a physics engine.
For simpler operations, Toxiclibs still does a great job (although it is a bit slower than hemesh) and you get a simple physics engine.
For a moving mesh (growing/folding/bending/…) I personally found Toxiclibs to be the easiest library to work with. It seems to me HE_Mesh is not really meant to deal with non-static meshes. Depending on the context you might have to rebuild the whole mesh at each iteration instead of updating a specific set of faces. I would advise asking @wblut on GitHub for a better and more detailed answer.
You could indeed import a separate physics library and apply the desired behaviors/forces to your he_mesh but the conversion between the 2 formats can be costly (ex: convert all the WB_Vertex of a mesh to Vec3D for force computation, then convert back to WB_Vertex for rendering). So, for simple forces like springs, attraction, planarity… you may be better off writing your own functions.
To sum-up: I would suggest Toxiclibs for origami-like folding meshes, and Hemesh for complex static meshes.
Thank you @solub. Good advice. I have tried He-Mesh it looks like you right it is not dynamic. But I will check on GitHub.
I have done some basic stuff using Toxiclibs, will try again.
You might also be interested in bRigid, which uses JBullet. You can download an direct-install it in your libraries folder in order to access the examples.
There is also a Menger Sponge example from PixelFlow that uses bRigid for its physics.
I already found it, and have placed the jar in the sketchbook/libraries folder within a folder with the same name.
But it still complains that the lib is missing;
(I unzipped the jar, and the requested files do exist).
The other two missing libs I found here.
But now I get the error:
NullPointerException
Could not run the sketch (Target VM failed to initialize).
Make sure that you haven’t set the maximum available memory too high.
The line 534 face = box.getChild(1); was highlighted
I tried different memory settings without result.
Edit: I commented line 534 until 541, and now it works.
It’s a pity that my PC is so slow, it’s running at 2,5 fps.
But it’s really an incredible lib. I’m going to explore it.
I’ve used HE_Mesh, ToxicLibs and plain PShapes all in the same project because each has its strength. It’s not hard to convert meshes from one format to the other. I actually used the first two to generate meshes and then convert them to PShape as they are kept in the GPU.
Even if the mesh itself is static, you can translate, rotate and scale them, you can move the camera, and you can deform them with vertex shaders, which is very fast. That allows you to bend, twist, stretch, glitch and apply all kinds of manipulations to them in real time (the same kind of deformations you have in Blender).