I want to share with all of you the progress of my current project. After released my molecular addon , many user ask to have a good "mesher". Mohamed Sakr give it a try with the OpenVDB librairy and get really good performance but have some memory issues with it. he waiting to get the librairy integrated with official Blender. Until this , I'm trying something different. I starting with this C++ tutorial ( Paul Bourke ) and this integration in Python ( Yeus ).
Download beta now available:
Rough documentation available here:
Making some optimisation and transfert it in Cython , I starting to get some interesting result as show here:
A - Calculation time it's for a 200x200x200 resolution cubes with the "peanut" shape function from Yeus.
1- Original Yeus python script (with it's original volume function): 900sec
2- Yeus python script with tritable has Global variable instead be call everytime: 160sec
3- Convert and adapt script to cython with somes optimisation: 5.8sec
4- Avoid creating voxel in memory: 5.8sec but Blender to stay at 80Mo of memory instead a peak of 1gigs.
B - Optimisations on how I get the particles volumes to be meshed:
1.bruteforce with all voxel = 10particles:2.3sec | 100particles:15.1sec | 1000particles:144sec | 10k particles: too long
2.bruteforce with voxel optimisation = 10particles:0.006sec | 100particles:0.16sec | 1000particles:3.8sec | 10kparticles:43.4sec | 100kparticles:435.1sec
3.optimised voxel and particles = Hard to benchmark because now voxel bounding box ajust by itself but for high numbers of particles the addons it's 10times faster.
4.Multithreaded and Space partitionning = Hard to benchmark now because voxel bounding box ajust by itself but for high numbers of particles ( 100k ... 1millions and many mores ) it's 10times faster then before.
Now I need to finish this things :
1- Beta test phase
Why I did this addon ? For having fun with the limited coding skills I have and learn about this algorythm. To give to Blenders users a good (I hope) mesher until a more experienced dev code one with openVDB librairy or similar.