I try to call Qhull from grasshopper and feed some commands to it. I tried shell() method and it didn't work for Qhull. Then I tried Winexec() but grasshopper kept telling me winexec was not declared. Every time I declared it vb script window gave me some syntax wrong.
I am a beginner of scripting and it really makes me struggling.
How are you calling Qhull? If I remember correctly, Qhull does not ship with any DLLs that you can reference. If you are after voronoi/delaunay/convexHull, why don't you try the built in Grasshopper functions to do so founder under Meshes?
Thanks for the reply. As far as I know, the built in function can only get 2d voronoi. Qhull is really good and efficient in 3d voronoi. The following is what I tried. Qhull requires some txt file as input points and i can output the voronoi ridges and vertexes information in another txt file. I write a vb.net script to output the points from grasshopper to a txt file that qhull can read. Then I write another one which can read the qhull out put txt into grasshopper to get the 3d voronoi faces and edges. I even output a .bat file in grasshopper which runs all the commands in qhull by double click it. The thing upsets me is that everytime I run the file by shell() or process.run, it just dosen't work like by double clicking it in windows.
Thank you very much for that! It really extends my knowledge. I didn't know there were so many ways of manipulating point set before:). The plugin is really handy.
However, I still wish there is going to be a grasshopper version of it. With grasshopper, I can easily link the index of input point with the index of the voronoi cell. But in the plugin, I can only link the points with the cells by my eyes:)
Hi Daniel, I remember Dimitrie Stefanescu posted an example to do this on his blog: http://dimitrie.wordpress.com/2009/05/01/3d-voronoi-in-grasshopper/ . It involves calling the Process.Start method, which is the .Net version of "double clicking" on an executable on the windows platform. As this example was made with a older version of Grasshopper, I am not 100% sure it will run on the current one. For sure, you will not need to reference System.dll on Grasshopper 0.6.30 or later. Hope this helps getting started.
I played around with Dimitrie's and Vicente's solution recently and found D's strategy involving qhull works only until v060012 for me. Dunno where the problem is located but maybe you can ask Dimitrie to get his hands on it again ;)
That is exactly why I want the version of my own:) Dimitrie seems to use C rather than VB and the defination does not output individual closed brep. Vicente's solution took several hours for 1000 points in my machine.
Thanks Dimitrie, it is exciting to see the new def which will work in the new grasshopper.
I will try that tomorrow. It is 41 degree in Adelaide and I can't think with my head boiling. I will have to turn the machine off to make the room cooler.
i think the qhull thingie didn't work in newer versions because of double referencing the system.dll file.
so just right click, referenced assemblies, select and remove and it should work...
Just as Giulio said above!
copy 'n paste from my blog comment:
I solved the problem in gh 0.6.0057 something (the latest version available) by un-referencing the system.dll. The c# comp was originally referencing an older version of the .net framework and that’s why i had to reference the new one manually – now it’s fixed and you get a duplicate referenced file.
So right click, referenced assemblies, select and remove…
Bug me again if it’s still not working…