ShareThis
More as a scripting experiment, when i was mucking about trying to make the delaunay triangulation work in grasshopper i somehow found the wonderfully complex qhull library which i promptly set to push and pull to get it to work with grasshopper. As advised on their website, the best way to do it is to call it as an external program, which is exactly what i’ve done: no files are written or read, no dos windows pop up, everything’s smooth.
Given that you don’t have many complex operations in grasshopper after the solution is generated, you’ll be able to handle quite an impressive amount of points (say 200 on my three-year old toplap) in real time. If you add the simple planarSrf operation, then say 60-70 and it gets sloppy.
What you’ll need to do to get things rolling:
0. Download the 3dvqhull definition and example file, and remember not to use it for commercial purposes, share-alike whatever you do with it and take the time to give the proper credits:
1. Download qhull, and unzip it in a folder of your choice.
2. Get going and search for “System.dll”. What you’re interested in is the 2.0 version which you’ll usually find in here: “C:\WINDOWS\Microsoft.NET\Framework\v2.0.5[...]\”. If you can’t find it, I’m amazed grasshopper works for you. Anyway, you can find and install it from here.
3. Add the newly found System.dll version 2.o as a referenced assembly of the qhull component in the definition file.
If it turns orange, it’s cool.
4. Write in the panel that is linked to the “path” input the full path to the qhull program qvoronoi. You don’t need to add the .exe extension, but you can do it if you feel confortable.
5. There’s just one more thing you should know: facets that contain the infinite vertex are omitted altogether, without remorse. So as to have as little facets tending towards infinitum, I always add the corners of the points bounding box to the input sites.
You can scale the bounding box in respect with its center, or you can just call the whole thing off – it’s your choice.
I think this just about covers everything. Take care and have fun.
PS: Qhull does more than voronoi. So if you have the time to explore and test, please do – the package is very powerfull and it can be used for more than this.
Nice work! Looking forward to trying this out
Hi Dimitrie,
thanks fot this powerful definition.
I tried in the past to work with different tool ( rhino> 3d max modeling, qhull and dritsas rhinoscript, gabe smedresman code, pointset reconstruction plug-in…)in order to realize this kind of space:
http://madeincalifornia.blogspot.com/2007/06/tmdtsunami-museum-voronoi-cells.html
i’m following the grasshopper google discussion about voronoi 3d, then let’s keep in touch and thanks for all.
davide
@Steen,
Be sure to have the latest grasshopper version 0.6 revision 12 if i’m not mistaken.
If that doesn’t work, let me know and we’ll se what’s going on.
i have no idea. maybe check you have version 0.6 rev 12+ but if you say you just downloaded it this is probably not the cause. maybe you can mail me the rhino file and the definition file so as to peek in them if i have the time.
might be something with your system configuration -or- did you properly reference the System.dll file and the qhull program?
are you sure you have the right access permissions for the qhull files/folder (read at least)? otherwise i can’t say. maybe your antivirus is blocking this, but this has a very remote chance of happening.
hello brandon,
calling qdelauny requires a new parse function for the output. please refer to qhull manual for an exact description on how to call qdelauny properly and get the right kind of output (which differs completely from what qvoronoi throws out with the included options).
It shouldn’t be hard, but it will take some trial and error style coding since debugging in grasshopper is like playing darts while being blindfolded during a small earthquake.
[...] This post was Twitted by FedericoWeber – Real-url.org [...]
Nice work. I was so excited when I saw this, that I immediately wnated to try it out. Unfortunately the ghx- file is not read properly in gh, it prompts some 32 messages at first and then shows a cluster that, when exploded is empty.
Do You have an Idea what the problem seems to be?
Cheers, and keep up the good work
hi dimitrie,
i’m extremely new to grasshopper… in fact, i’ve just downloaded it to give this a go. i’m receiving an error at the bottom of my window saying “All curves failed to load…”. Any idea what may be causing this?
Also, if you could recommend a good place to learn more about grasshopped it would be much appreciated. Thanks.
hello nino,
the bloody cluster just adds to the pointlist the 8 vertex of the bounding box of the point to have as little facets with vertexes@infinity floating around (this way you only get 4 cells that contain the infinity vertex, so the facet number is limited.
Depending on what you want to do, you can take the vertexes of your enclosing geometry (mind you not a perfect sphere or it will fail) and add them to the point list and see what happens or, so as to get similar results to the pointset reconstruction tool you can remove the cluster object and then perform some a boolean intersections so as to cut out any cells or parts of cells that are outside your specific geometry. unfortunately this is highly computationally expensive, so try it at your own risk…
Cheers for the immediate reply,
everything works great!!!
Now the fun can start!
Thanks again, I’ll keep u posted on my progress.
Hi,
Thank you for this wonderfull definition!
I was trying to achief something similar…but I gave it up, because it took to long
The only problem I have, is that I don’t quite understand the cluster object…
I would like to grow the structure inside a specific geometry…not in a bounding box.
Do you know how I can do this ?
Thx
Thanks a lot for the very fast answer!
I’ll give it a try!
I’m an architecture student and I’m hoping to be able to use it in my final design.
I’ll let you know what my final outcome will be!
Your work is really inspiring, can’t thank you enough!
Hello
Recently tried to open the .ghx file and it comes up with a “IO has generated 32 messages would you like to see them” prompt.
I have the latest Grasshopper ver.
Any suggestions?
Thanks,
CP
Hi,
when I tr to use it, I get the error
“access denied”, related to the qhull files.
Any ideas?
Hello, problem is the last version of grasshopper.
Here, in france last version is 0.5.0099 so your script doesn’t work.
I think that for us residents the last version is : 0.6 rev 12 as you say.
So we have to wait for new version
thierry
I’ve been trying to call the Qdelaunay and can’t seem to get it to work. Any Suggestions? It can’t be as simple as replacing the file in the grasshopper definition…
hi dimitrie,
i’m a beginner in rhino, how can i get the holes, after generating the surfaces? thanks for your answer!
bake the curves component – it’s connected to the “D” output handle of the qhull node.
best,
d
[...] stefanescu posted step by step instructions on using the qhull grasshopper definition on his blog. it’s pretty thorough, so I thought it was helpful to see how you can load a [...]
in the output window the following text is to read:
-The using directive for “System” appeared previously in this namespace Script
-exception: Zugriff verweigert (Acess denied)
–qhull start–
you can ignore the first warning (it’s nothing important).
the access denied problem i’m afraid i can’t control or tell what to do with it.
please send the file over, and also check your permissions (maybe the qhull folder is protected somehow).
hi dimitrie, thanks for sharing, one beginner question again, after i be able to achieve what u did in the image at the top, the geometry is basically planar surface from the definition, so how do i give them thickness and smoothen further?
thanks
HI MY NAME IS DANIEL I´M ARCHITECTURE´S STUDENT, DO YOU HAVE SOME INFOMATION HOY TO CREATE A 3D VORONOI INA CURVE SRF, THAT IS FOR A PROJECT OF MY UNIVERSITTY FOR AN AIRPORT.
THANKS A LOT.
So, I am trying to work with your GH script ..But I receive such a error message ..
0 The using directive for “system” appeared previously in this name
1 script exception:Access Denied
Could u help me to resovle this problem ?
I’m trying to work with your ghx code, but
it is quite strange shape.
When I use point reconstruction set by McNeel, its output is box shaped.
But your ghx code generates diamond like shape.
How can I obtain voronoi shape (box-like shape) with your ghx code?
I think real-time point manipulation is quite good!!!
And how can I generate a hall on generated model?
For example, http://madeincalifornia.blogspot.com/2009/05/grasshopper-3d-voronoi.html
Thank you dimitrie.
But, still I curious about generating void voronoi diagram like http://dimitrie.wordpress.com/2009/04/30/qhullghlove/.
Could you upload your script?
Hi, thanks for this little tutorial, I’m all new to this parametric world and this is verry helpfull !!
Verry nice blog actually, I’ve been around it and I really like the urban bacteria, really interesting work!!
tnx for the tutorial!!!!
Hi Dimitrie, this is a great definition. I just have a somewhat beginner question. It seems like I can’t really bake the generated curves. when I highlight the curves and click bake, nothing happens. Do you have any advice for this? Thanks!
Hi Dimitrie.. I’ve been working with your 2d voronoi definition lately and making some extrudes with attractor points, and its been working great for the aproach I’m looking for.. but I’ve only been working for several weeks and I don’t know if I can render something out of grasshopper directly, or how can I render any model, or maybe I’m going the wrong way, do you know any tutorial I can look for? or what do you recomend me to do? Thanks!
extrude them for thickness, fillet them for roundness. proper smoothing of surfaces is quite difficult in gh since the only way possible would be via scripting nodes which can prove quite a hassle… depends on what you want also.
Hello davide,
thanks for the kind words! and heads up for the tsunami project. Cool stuff!
Perfect! Thanks!
Hi man, thx for this work, would be consider for the gh developers for next releases. I’m researching the voronoi parameter in architecture, and, your definition appear the best interest way. But I’ve a problem, Can u help us for the people that so show the message: “script exception: Acces Denied”.
I’ve thinking it should be, for that i have updated my system until Framework 3.5 (not only Framework 2), or I wrong and the qhull would work right anyway.
Please discuss about
how do you get the ‘referenced assemblies’ window to come up? sorry, somewhat new to code…so i can’t follow where the window is coming from.
hey dimitrie thanks for great work you have done. I am attempting to delete the reference points from the example file and input new ones that I specify but I’m having some trouble getting it to display the new 3d voronoi based on those points. I was just wondering how I might alter the script so that I can use my own points. Thanks so much.
sorry, one more question: I’m just starting out in Rhino and GH and have more experience in 3ds max so I was thinking about exporting the file so that I can make further alterations in that program. Have you done this or do you work exclusively in Rhino? Whats the best way to go about it? Any suggestions would be really appreciated. Thanks again for sharing all of this, very exciting stuff.
hi
i am trying to run the command in the new version of GH. Any suggestions.
Best
Phaethon
Buy:VPXL.Viagra Super Active+.Viagra Super Force.Viagra.Viagra Soft Tabs.Propecia.Soma.Cialis Professional.Zithromax.Viagra Professional.Cialis.Maxaman.Cialis Soft Tabs.Super Active ED Pack.Levitra.Cialis Super Active+.Tramadol….
there was some discussion going on in the grasshopper3d.com website.
you can check it out here.
It basically says that It might be because qhull.exe is still being quarantined by Vista. Otherwise, what happens if the user is not an administrator? That could be a cause as well, particularly on some very-safe systems.
well, pointset reconstruction was doing some very expensieve boolean operations to get stuff inside the box (basically cutting out everything that was outside) – you can’t do that yet effectively inside gh.
bake and cut is the only solution i can give you for now.
hey dan, this sounds like a gh problem, not from my side. Are you sure you are not baking the scripting component, but the little parameter boxes in which i feed the curves output of the node?
Thanks for your quick reply Dimitrie! I am trying to bake the component labeled “curves” that’s attached to the D output of qhull and nothing is showing up when I click on it and then bake.
I find that if i feed the “curves” node into the Planar component (instead of the poly), I can then bake the generated surfaces themselves, but that doesn’t really give me the curves. should the “curves” component be fed into something else?
update: I think I figured it out. I outputted the curves to a planar node then took the two outputs (from polygon and curves) and trimmed one from the other and baked that. It seems to be giving me what I want.
Thanks again for your help and let me know if you would have done it differently.
hey javi, just select from grasshopper the final nodes of your sketch (the geometry should turn green in the viewport) and then click the bake button (an egg) from the toolbar. that should work.
hey marcel, try this out:
http://www.grasshopper3d.com/forum/topics/live-external-input?page=1&commentId=2985220%3AComment%3A8845&x=1#2985220Comment8845
the error is fucked up, hopefully the topic above helsp.
also thanks for the heads up
can you please post some details as to the errors involved? i assume you’re talking about grasshopper v something something 0043?