(copypasta from my website)
QHull in 3ds max

I stumbled over the http://www.qhull.org/ library and it got some really powerfull features like computing convex hulls, Delaunay triangulation and Voronoi diagrams. Decided to try and get some of these features to 3dsmax, so first of is a 2d Voronoi diagram as a geometric object plugin and a convex hull script. Instead of writing a c# wrapper I took an easy workaround piping the output from the cmd window into 3dsmax using .net. I guess there is some extra overhead doing it this way, but compared to the meshing time in max, it is miniscule. For the 2d voronoi diagram you can interactivly change the number of points giving a instantly a new diagram/mesh. On my old pc I can mesh a diagram with 2-3k points interactivly.
The second script using qhull is a standard convex hull generator. I have not tested it against other convex hull generators in max, but I guess it is pretty fast where the meshing part and file IO in 3dsmax is the bottleneck.
I'm planning to add particle support to add points to the 2d voronoi diagram, but I'm having a hard time passing large strings as a argument in the cmd window. For the convex hull I solved it by writing the vertex data to a file and pass that on to qhull. This would not be a good solution for the particles if they are animated, as far as I can see. These two scripts are more like tests than full blow complete scripts, so it may be bugs in them!
Download:qHull2Max.rar
Extract all the files to the same location. If you permanently want to install the geometric plugin in you need to place it in the plugins folder as described in the help file, along with the qvoronoi.exe and rbox.exe files

onodi.andras · 2011-09-30
kilad · 2011-08-30