## Voronoi Kündekari

Kündekari is an old woodworking technique, composed of interlocking parts without any glue or nail. It is primarily used in wooden doors and minbers inside Mosques. The interlocking system makes whole structure very durable. Unfortunately very little information could be found on the web about this beautiful technique. Below you see a typical example of Kündekari components and the resulting pattern composition.

The subdivision part is out of the scope of this post (as it might be anything). The interesting part is the tongue-and-groove method, something like a puzzle. In fact, creating 2d puzzle details in 3d is enough for this system as it is a planar surface. Although it is very easy in Rhino to create such planar interlocking details by using boolean operations, I found it very interesting and (hard) to implement this interlocking with a non-regular subdivision such as Voronoi. In a regular subdivision such as hexagons, it was way much easier as you see in below, the trifoliolate (explained here).

In this case, the tongue-and-groove joint is created by using the segment indexes of each hexagon as every hexagon in every column is the same. So we can tell Grasshopper to use tongue detail in odd indexed segments, and groove detail in even indexed segments etc. However when you use a non-regular subdivision method , this regularity also breaks. You have to tell Grasshopper which edge is tongue and which edge is groove one by one. In the real world it is a very simple decision, but it is a mess for a dataflow algorithm. Consider a simple voronoi subdivision, with cells composed of 3,4,5 or 6 edges. If you go further with this cell oriented approach you’ll see that it is very hard, and sometimes impossible to define a strategy to decide which edge of which cell will be tongue or groove. I hope you understood me in this. However I decided to go for another approach; just splitting the planar surface with simple polylines with puzzle-like detailed shapes in the end. This seems easy but unfortunately, the Voronoi component does not allow it that easy;

First I used a simple voronoi component to create the cells. Then, each cell is exploded into segments. Now, I just have to modify these edges by drawing puzzle joints to finish the job. As I told before, if you don’t use a regular subdivision, you cannot determine which edge should have tongue or groove details. Considering two adjacent edges of say, a triangle and a hexagon, might both be tongue or groove.  So, we have to move on with a segment-level modification, instead of a cell-level modification. That’s why I exploded and flattened the segment list there.

The real problem is; I have to tell Grasshopper to remove all duplicate edges (as an exploded voronoi cells create duplicate edges). There is a component called duplicate points in Grasshopper but unfortunately no component is detecting and removing duplicate lines (such as the overkill command in Autocad). The first part of the solution deals with this challenge. I sorted the flattened list of segments, checked their lengths and removed the duplicate segments with same length. If you use very regular (such as square) points with the voronoi, this part will likely crash because I check the edge lengths to identify duplicate edges. A more sophisticated solution should check the start and end point coordinates (both of them for sure). Anyway, I continued with creating a list of curves, with no duplicates.

The brain-fucking part is over now. Now, I can modify these edges and split the boundary surface with them. Finally, tongue-and-groove effect is finished now without caring much about the number of edges on the subdivision. Here is the Grasshopper definition with explanations on it. [GHX: 0.9.0056]. It is very funny to play with parameters and voronoi points to see that it is working. Just put two layers of actual subdivisions over and below this: there you have your variational Voronoi Kündekari.