[Plugin] QHull
-
OOOhhhhh.... oversight on my part!
When examining the standard SU 'model', there usually aren't construction points. Everything is edges and faces. So, I just search for all the edges and use the starting vertex for each edge (to avoid duplicate points, I don't use the end). It never occurred to me to also search for construction points, but I can see how that would be useful!
To see how the selection part works now, create a random convex shape. Then select the component, and do voronoi on selection. There you will see how it works. In the meantime, I'll update it to capture construction points also.
As far as purpose.... well... it's artistic, right?
Actually, convex hull can have a legitimate purpose. If you have a complex model, do a convex hull selection on it, you'll get a sort of 'shrink wrap' shell of the entire model. I'm sure the others have legitimate purposes too. -
Add the actual plugin! (D'oh)
EDIT: Updated to work for SU6
EDIT 5/14/2009: Updated to work with ConstructionPoints
-
Fixed for using Construction Points.
-
A tutorial or two to demonstrate how to use this plugin would be nice.
Regards,
Bob -
YES...YES.....YES!!!!! Everyhing is working now! Thank you especially for the update for use with construction points. I tried every variant I could think of, lsystem point clouds, sandbox mesh grids, convex geometry groups....it all worked.....flawlessly! It took awhile but as I told other members in other related posts.....somebody in this terrific community forum will come in and save the day!
Thank you avariant!!!
-
My pleasure. It was fun, and I've always been a fan of the 3D Voronoi shapes.
-
MALAISE
-
I haven't been able to generate any shapes with selected shapes, or with selected construction points, if in a group/components/outside a group/component. I get the following errors:
"qhull generated empty results"
"qhull failed to generate valid results"ideas?
-
If your points are all on the same plane, then you won't get any results.
To ensure it works at all:
1.Create new, empty scene.
2. Plugins->Qhull->Convex->Medium
3. A convex shape should be created. Select it.
4. Plugins->Qhull->Voronoi->Selection(Free)
5. A spiky shape should be created.If all that works, then the problems is your input data (ie model / points).
-
I honestly don't know the math, but A LOT of regular shapes, like cubes, planes, etc, don't generate valid voronoi results. They may still generate results from the other options, and will often work if you choose Selection (Sphere) or Selection (Box). I don't know why... math, right?
-
So is that normal?
Always take a convex volume for any function
-
No problem ! Thats fun
(click image for erase scroll bar)
-
Avariant - Thank's for your Qhull.rb - it could be a crucial piece of the puzzle I'm trying to solve, except I can't get it to function with my own (grouped) convex form.
@avariant said:
If your points are all on the same plane, then you won't get any results.
To ensure it works at all:
1.Create new, empty scene.
2. Plugins->Qhull->Convex->Medium
3. A convex shape should be created. Select it.
4. Plugins->Qhull->Voronoi->Selection(Free)
5. A spiky shape should be created.If all that works, then the problems is your input data (ie model / points).
Also, if I follow your test instructions, Steps # 1-3 work, but using 4. Plugins->Qhull->Voronoi->Selection(Free) {or any of the other selection options for step 4) yields no results. Using one of the non-selection size options (small through huge) as Step 4 yields the anticipated spiky shape.
I'm having the same trouble as Halroach (did you ever find the solution why?)
@unknownuser said:
Re: [Plugin] QHull
Postby Halroach on Tue May 19, 2009 8:07 am
I haven't been able to generate any shapes with selected shapes, or with selected construction points, if in a group/components/outside a group/component. I get the following errors:
"qhull generated empty results"
"qhull failed to generate valid results"Please help me find a path to generate voronoi shapes from convex polygons generated and selected by me (not by Convex).
Thanks!
-
@22curious said:
I'm having the same trouble as Halroach (did you ever find the solution why?)
I haven't found a solution yet...
-
Can you post a small example scene?
Very "regular" results, like a cube, a sphere, all geometry in a single plane, usually won't generate valid results. It's just how the mathematics work.
-
Hello!!
Thank you for the plugin!
It s AMAZING!
But I have the same problem as Halroach.....
... I select the group, (the convex medium), then I run voronoi Selection (Free), and suddenly, sketch up window is minimized, and appears the two error messages ...:
Qhull failed to generate valid results,
Qhull generated empty results
....Thank yoouuu!!
-
Avariant & Halroach - thanks for the prompt responses - sorry for my delay. Drowning in plugin options, looking for solutions.
Here are examples of a few of my attempts to get Qhull to work with construction points, …because isn't the 'convex' script supposed to form the skin over specific construction points?
Stall from Qhull>convex>selection, using group created by Lsystem, pointified, and grouped:
Same result from Qhull>convex>selection, removing the lines from group created by Lsystem, leaving just the grouped construction points (even though the lines are supposed to be ignored):
Attempt to compare the object formed by selecting the point-cloud group above, Qhull>convex> Large(100), which created an apparently random small convex polygon at the origin. I scaled up the polygon (evenly), made the faces transparent, and superimposed it on the point cloud to explore whether there was any apparent relationship between the polygon created and the group of selected points. It seems there is none…?
Attempt to form a convex hull around irregular polygons Qhull>convex>selection. Tried it grouped (shown). Same failure message, with an apparently random small convex polygon at the origin. This one seems to have no relationship to the objects to be 'hulled' either:
Tried the same thing ungrouped , same (unrelated) result:
Tried using Qhull>convex>selection on the selected points (after pointifying the objects above, then exporting the points), creates an object, but there's still no apparent relationship to the points:
Stall (sort of) from Qhull>voronoi>selection, using group created by Lsystem, pointified, and grouped. Got same failure message, but the Qhull>voronoi>selection did put a spiky object at the origin:
from Qhull>delaunay>selection, using same group. Got same message, but if did put a spiky object at the origin:
Result from Qhull>half>selection, using same subgroup.
Again got same message (Qhull failed to generate valid results), but there IS a very small, apparently random spiky object at the origin:I need to be able to manipulate surfaces formed from imported CSV points …not random objects.
I'm looking for Qhull's convex.rb to generate specific convex hull surfaces, for voronoi to crack them ...as voronoi is supposed to do. The random spiky objects are fun, beautiful, and maybe even useful - but random. And are the anticipated 'cracks' reversed, forming the spikes?NOTE: I appreciate that some of the transformations I need can be handled by some of these awesome scripts:
__Didier's points_cloud_triangulation.rb (finally got it to work after spending LOTS of time tracking down the required fix to the delauney.rb file, removing the './').
___Finally got ArchitectBoy's skin.rb to work when I found Christian_dl's skin-26 version… as long as I use the icons, (though it does not function through Tools> skin.rb ...?). So this creates a convex hull around faces & other polygons…but I haven't found a way to implement that script using points, or to follow with voronoi.
___ Kirill2008's Pnts2mesh.rb is also very useful - (but can we get it to work with voronoi?)
__ Chris Fullmer's clf_simple_loft.rb is great for regular lines and surfaces
BUT…has anyone gotten voronoi to act on (crack) surfaces created in these alternate ways?
Many thanks. 22curious
-
Avariant and anyone using Qhull: Will you please post examples of:
- Results from successful use of Qhull with selected construction points (esp. voronoi)?
- voronoi results that show a 'cracked' surface?
Here are links to interactive voronoi examples:
- 2D applet http://www.cs.unc.edu/~snoeyink/demos/crust/home.html
- 3D http://www.youtube.com/watch?v=yVr4-Dogz5g
Thanks for your feedback!
-
Here is a very simple collection of points from which I generated a convex hull, delauney (which appears to connect nearest neighbors), and voronoi. They all worked.
Just to clarify in your above examples, you say you used Convex->Large(100) and it didn't match your selection. As clearly stated, Large(100) creates 100 random points, and has no correlation what so ever to your selection. Only the choices with "Selection" in them use the selected items in any way.
Also, if Qhull (the 3rd party exe) fails, the script might use old data to generate the shape, which is why, despite the message, you may see a shape created.
-
I've tested the construction points grouped and it works just fine. I think your problem is that your points are too regular or all on one plane. I don't know why that causes a failure, it just does.
However, as far as creating what you call 'cracked' surface, the basic answer is that's not how voronoi is being represented here. Voronoi is a mathematical representation in which each barrier is equidistant from its nearest points, giving the telltale cobblestone appearance. What you are missing, however, is that along the boundaries of your sample area the cells are undefined. In all the images you see, the cells are just clipped off in a nice rectangular boundary. A similar method could be done in 3D (like the youtube video), but in this case, it's not. I'm not 100% on the math here, to be honest, but what I think is happening is the cell boundaries are being evaluated out until they "close" naturally, resulting often in long spikes. If you delete those spikes on a simple example, you will see that the cell boundaries do, in fact, lay equidistant between nearest neighbors.
The problem, I think, is that you are expecting it to look like a 2d cobblestone image, but the 3D representation just doesn't work that way without the artificial boundaries.
Advertisement