by Tuğrul Yazar | June 26, 2023 21:15
I have created a straightforward Grasshopper code that generates a Voronoi diagram on a surface. Then, it adds thickness to form a structure called a “Voronoi Cage.” In the initial step, I project a surface onto the ground plane (Z=0). The projected frame serves as the boundary for two operations: generating random points using the Populate 2D (Pop2D) function and calculating the Voronoi diagram based on these points. The resulting Voronoi cells are then slightly offset inwards.
Moving on to the next step, I use the Project component to project the offset Voronoi cells onto the surface. I accomplished this by applying a vector in the positive Z direction. Using the newly projected curves, I utilize the Surface Split (SrfSplit) component to create separate parts on the surface. In this case, I chose not to directly connect the curves on the ground to the Surface Split operation. Because the project operation seemed more appropriate than the pull operation.
By experimenting with dividing the surface into parts, you will notice that the last element in the list of divided surfaces represents the frame of the cutting process on the surface. To extract this specific surface, I employed the Reverse property in a List Item (Item) component. The first element of the reversed list (index 0) corresponds to the last element of the original list. After selecting the appropriate surface in this manner, I finalized the application by subjecting it to the Extrude (Extr) process.
You can rebuild the definition by looking at the diagram above. However, if you want to support this website by downloading my Grasshopper file; would you consider being my Patreon? Here is the link to my Patreon page[2] including the working Grasshopper files for the Voronoi Cage and more.
Source URL: https://www.designcoding.net/voronoi-cage/
Copyright ©2024 designcoding unless otherwise noted.