algorithmic modeling for Rhino
I am trying to do the following: I have a constructed my voronoi and I want to trasfrom them-- specifically I want to stretch or compress them according to specific points. (see images) So, I got the voronoi breps and their points , I dispatched them into two groups( the ones moving and the non-moving) , then I joined them back together but I can't reconstruct the faces of the voronoi correctly. even though it seems that the points have maintained their order. check out the before-and-after images, definition and file.
I can't figure it out, plz help !!
and here is my gh definition:
Just a quick idea, before I take a look at your def.:
How about inserting a sphericaly point cloud around the attractor? Then cull all the cells created by the additional points. This should shift the boundaries of the cells next to the attractor away from it.
im not sure but if i have to guess, the new polylines arent planar so the planarsrf fail...
hm..I just checked the original surfaces for planarity and they seem to be ok..any other ideas ?
I didn't take a good look at your definition but I can't seem to find a 3d voronoi component you are using?
From my understanding it seems to be a problem of an attractor point pushing the points in a point cloud and then 3d voronoi it (the points being centre points of the 3d voronoi).
Update your GH please. 3d voronoi is available since 0.8.0063 and sits right next to 2d voronoi.
I side with Hannes on this. I see, you have some python components in your definition. If there is no need to maintain this exact methodology , I strongly suggest to rebuild your definition using the embedded v3d component. You'll achieve the same result with only a few components and avoid data tree miss-matches.
well, my gh is quite up-to-date, and I am indeed using a gh v3d component -it's right there..I know that it's still messy :P The python components are absolutely necessary (unfortunately) and they serve very different purpose ( it allows to move from layer to layer and perform the same action). Ok, let's forget about my definition-- what other options do I have if I want to deform 3d voronois? seeing that they always form into a normal rectilinear bounding-box? Hannes, I don't get very well your idea for the spherical point cloud, I would really appreciate it if you could elaborate :)
The voronoi3d comment was meant for Ching, not for you.
I tried to implement my idea but couldn't quite get it to work. The concept was that voronoi forms planes that are perpendicular to the line between two neighbouring points. So in order to move the bases upward, you'd need to insert points between the generator points for the affected cells and the attractor point. This would create new cells at the bottom of the original volume. You'd need to remove these.
I only invested little time and couldn't work out where to best insert the new points.
Since I don't have GHPython installed, I couldn't check on your def.
Ok Sofia, i think i managed it! The definition is a bit long, complicated and slow to process - but you can always improve and 'clean' it ;)
The main strategy was the following: because when you 'squeeze' the box there is a deformation on the top side of the box, what i did was populate the deformed surface with 'cell centers' (points) and add them to the collection of points inside the box (that also move according to the deformation). This final 'merged' collection of points will then generate the voronoi cells.
The voronoi cells' shapes depend on the relations (positions and distances) between the generative points - so in the end this would be what you would change, not the end geometry.
Hope it works for you; i'll be waiting for critiques and commentaries ;)
:D :D it absolutely does, I didn't think of populating the deformed surface with cell points :) thank you sooo much, that makes it so much easier! you made my day ( and my project :P ) will apply it right now and will let you know later how it looks like!
huge hug xxx
Glad i could help: it was a nice challenge ;)