Grasshopper

algorithmic modeling for Rhino

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.

Views: 1070

Replies to This Discussion

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.
Have you tried the PointSet Reconstruction plugin for Rhino? Its got 3dvoronoi, built right into Rhino. I think it might be a lot more convenient to use over QHull.
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.

- Giulio
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 ;)

Best Patrick
Thanks a-ngine.
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.
what i did to get closed breps: i called qhull again (in a different scripting comp) in which i was calling qconvex. lemme see where i put that thingie...

it's still rather slow, and 1000 points is def a no-no, but it's rather 3-4 secs on my machine for something around 100 points...

And just replace all EH_ prefixes you find with the new GH_ prefix.
Hope this helps! Now off to school with me... yep, still wooden huts and shit.
Attachments:
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.
Hi Daniel,

any new developments in getting the closed breps done via qhull? I tested D's version but the performance is quite slow so if you got some improvements just let me know.
hallo all,
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:

Hello,
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…

My file isn't referencing anything at this point and I can't get the lines/planes to load. Let me know what to reference. 

 

-Giles

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service