An explanation for the TJKolam application in the PoPP archive S V Ramu (2002-06-29)
A PoPP archive explanatory article, for TJKolam
Well, I'm not an expert in this hoary art of South India. In fact, it is this
envy of mine towards these unassuming household artists that prompted me to
automate this sophisticated and artistic curve drawings. The above samples are the flavors I'm interested in. These drawings were created with the TJ Kolam program, available in the PoPP archive. The first one is a straight forward print screen, but the second is a merge of two three Print Screens. The goal of this application is to allow printing and saving of these kolams, from an easy to use interface, where you can create these beauties. Maybe we can make a kolam screen saver too! For now (PoPP's TJKolam 0.1 version), the algorithm is in place, but we still need to spruce up the interface, before it could be useful to my granny.
In Tamil they are called
Fortunately as it turned out, I found lot of invariants in these drawings. For one, there is symmetry. But more than that, I found the following interesting feature which could make any (I mean any 'neli') kolam simple. I have a strong suspicion that this following bubble model should be known to my unsung kolam teachers, because I now remember seeing them rubbing some knot while trying to remember an old kolam. All the same, I've never seen them exactly using them as a main technique for creating a new kolam. As far as I know, new kolams were created only by sharing with others, or over time by modifying an old and famous one. By the way, just to stun the uninitiated, the first of the above is a single continuous line! The second has two lines (three if you count the inner circle). (Don't tell this to my mom, or yours, she might ridicule me for exaggerating this seemingly simple thing! Simple it might be for them, for me at least it was toil. Toil of pleasure though.) Even after a couple of years of exposure to these kolams, I simply cannot stop wondering at these marvel of curves, and the genius of the womenfolk who foster this art. The problem is how to concoct a new kolam? If I try drawing a curve right away, I'm assured that I will get stuck somewhere soon.
The trick is to use the symmetry of the kolam. The typical symmetry used is the cyclic symmetry, as shown in the above figure. This is also the most complex and the most impressive one, apart from being the most common (the others are reflection symmetry between the halves). This reduces the problem of remembering the whole kolam, to one of remembering just one quarter of it. Of course, nothing stops us from creating a completely asymmetrical one, but I haven't seen it in daily use (maybe I should explore more of that, now that it is easy with this program). I think this symmetry part has been used extensively by the kolam creators. But, this is not enough. You need more patterns to make kolam drawing as simple as connecting points with line. If you see the above figure, I've specifically shaded the closed areas that contain the dots ('Pullie' in Tamil). This way you can see clearly that a kolam is just a connected network of many 'bubbles' (if you can call these shaded parts so). This is important because, this way you only have to join different dots creatively, and the regulation part of weaving the curve around them could be automated. This is not to say that joining dots is easy, because traditionally only certain dot-connections are considered beautiful. You are free to explore, but don't blame me, if your mom gives an indifferent glance to your masterpiece. The above are some frequent and pleasing connections of dots. You can see the connecting lines in green in the above figure. The darker shaded bubbles, is only to highlight that, if a dot is connected to one or more dots, the bubble will be connected similarly. I have highlighted one vertex each for degree 1,2,3 and 4. But how to draw the kolam curve with this concept of bubbles?
If you see the sample kolams above, and observe the curve in the vicinity of the
dots, you can see that it follows intuitive and simple patterns.
I've enumerated these crossovers for vertices of various degrees. This picture was
created by enlarging the kolam and rubbing out the irrelevant parts.
Note particularly that a dot with
a given degree can manifest in various angles. For example, see the difference in
curve form for the dot of degree two. This seemingly insignificant point can confuse
a novice's mind. When you see the link of bubbles with these crossovers, the curve's
path should be pretty clear. But again, how to draw the curve in one single flow,
without resorting to modeling the physical bubbles? Some commentary now... Since 1 and 2 are connected by the green line, a curve starting from the bottom cuts the line 1-2. The control is transferred to the point 2. Since 2-3 is connected, and since this line is the first of 2's from the curve's point of view, the curve cuts this 2-3 line and the control of decision is transferred to 3. And so on. The green connection line is shown in blue to highlight this control changing path. You can also imagine that the curve going from 1 to 2 is a clockwise sweep, and from 2 to 3 is an anti-clockwise sweep. Again a clockwise sweep from 3 to 4, and so on. This 'sweep', so to say, alternates between points. This fact is used in the program source as the variable "wise" (clockwise or anticlockwise), which alters between +1 and -1. This logic gives an unambiguous way to generate the path of the curve. After making the connection lines in the dots grid, we can use this algorithm to generate the path of the curve, by starting from any point. If the curve is not single threaded, then you might have to start from another point. Once started, the algorithm automatically ensures that the curve comes back to the starting point, to form a closed curve. By the way, I haven't worked out an optimal way to find all the staring point required. For now, I either do it specifically for a kolam, or assume all dots as starting points (this make the curve thick due to over drawing - maybe due to rounding off errors).
Now for the final piece of puzzle. I found the above logic few years back, but
couldn't produce this program then, because of my ignorance towards
computer graphics. In graphics, there is this notion of drawing a In this program I have used a very crude logic for this stitching, which shows up in some non-smooth squiggles in corners. I'm now exploring B-Splines and some exotic but famous thing called NURBS (Non-Uniform Rational B Splines). All these are some variations of interpolation, and are hence recursive in definition. You can get more information on these at this interesting link. These are interesting in their own right, while also being useful for drawing kolams. |