Grasshopper

algorithmic modeling for Rhino

Hello, i have used grasshopper for a while (since 2014) and never came here cause my english was not very good (not that now is). Well, recently i got stuck with a question about weighted voronoi, basically i needed a 3d weighted voronoi to create a controllable screenwall. I looked here and in other sites trying to find an answer, but all what i found were some approximation of the issue. So you know:

http://www.grasshopper3d.com/forum/topics/weighted-3d-voronoi-possi...

This is an old post in the fórum (even before the gh comp. voronoi exists) about the theme, although i have understood the theory of weighted voronoi, it was impossible to me to carry this logic to a grasshopper algorithm, even though i tried.

http://www.grasshopper3d.com/forum/topics/voronoi-customization-wit...

This is a short post about the theme that seems have achieved a solution. I don't know if it was my lack of knowledge (probably yes), but i could not uderstand how the presented solutions solved the problem. :/

http://www.grasshopper3d.com/forum/topics/looking-for-weighted-voro...

This is the longer post about the theme i have found. It presents a very good approximation to 2d weighted voronoi and i could manage it, but i could not find a way to carry this logic in a 3d voronoi.

http://www.grasshopper3d.com/forum/topics/differentiated-voronoi

In this post i learned that weighted voronoi creates hyperbolic curves instead of straight lines, what made me wonder if it would be possible doing a 3d weighted since i needed flat surfaces in the cells. However in this same post i read something about power diagrams, what brings me to the next two links.

http://graphics.uni-konstanz.de/publikationen/2005/voronoi_treemaps...

https://www.uni-konstanz.de/mmsp/pubsys/publishedFiles/NoBr12a.pdf

These links are of two papers about the using of voronoi in the development of a treemap (i'm not entering in the details of treemaps here, but  the papers give a good introduce if you are interested). Well, i learned that basically are two types of weghted voronoi diagrams: Additively weighted (this one creates the hyperbolic curves) and Powered weighted (this one creates straigh lines). In the papers the authors present their scripts to achieve the diagrams. I have studied python a little bit, but my lack of knowledge (again) in scripts did not allowed me to understand their complex algorithms.

http://www.laratomholt.nl/ghscripts.html

The last link (finally) have some grasshopper scripts of a researcher named Lara Tomholt. One of these scripts is about weighted voronoi in 2 and 3d and achieved a very good approximation of it. However it still has some voids between the cells, what is undesirable to my objectives.

Sorry for this big research historic, but since the theme has been very discussed, i thought it was a good idea show this "state of art" for a better understanding before showing my developments.

Joining all this knowledge achieved through research and a bit of what i already knew in grasshopper, i have been trying to create my weighted voronoi in 2 and 3d cells. I started trying to make adjustments in the scripts found in the links and honestly don't remember exactly how i got to this file attached, probably a consequent of the very try and error.

The script is based in the conectivity of the deulanay mesh component.

Basically i used the connections of one point to create influence in the points connected to it by scaling a line between them, while using the original point as the center of scale and using the new end points as inputs in the voronoi component.

This approach solved the problem for a 1 cell weighting, to make it work in more than 1 cell i used a recursive looping with hoopsnake for make it always consider the new set of points while adding the weights (better understandable looking the script).

This approach seems to work until the penultimate point (probably because of the nature of the delaunay mesh connections i guess), but most important could be used with the 3d vornoi component.

In the file attached i used a range component to create a increase in the weight of the cells aligned with the sequence of the points referenced, of course other methods can be used to create more dynamic weights in the cells.

Well, i'm not sure if my approach is the correct one to solve the problem, neither if it is really a solution at all, so i'm open to suggestions, reviews and comments that can validate or not this aprroach, also open to new solutions in the case.

Sorry for the big post and the not very good english.

Thank you for Reading. :)

Views: 1541

Attachments:

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service