Playing Around With Guilloche Patterns


In my first attempt at rosettes, I failed to realize immediately that having the "wheels" was no longer needed. Previously we've been able to use our system of wheels following an arbitrary path to produce interesting images, so why not make the path the midpoint between two envelope functions, and scale things such that we fit things just to the edges of the envelope functions?

Easier said than done.

First, how to make the envelope functions? This is not so hard.

For a start we can use our arbitrary path system to construct an envelope function (there is a slight problem with this, which we will get to.)

As another possibility, we can construct a circle easily enough:

	x = r * cos(t * C);
	y = r * sin(t * C);
Then, we can make r a function of t as well:
	r = cos(t * C * M) * R + min_radius;
	x = r * cos(t * C);
	y = r * sin(t * C);
Now we have a kind of undulating circle.

Now, how to scale our drawing so that it fits between the inner and outer envelope function?

This is where it gets ugly. The envelope functions are defined by a few constants and by t. t is used to determine an angle to feed cos and sin functions to ultimately determine the values of the envelope function at that value of t -- which means at a particular angle determined by t.

The path of the pen is also determined by t. However, it is offset in both x and y as the system of wheels spins around. So the angle which must be used to determine the scaling factors to use to keep the drawing just touching the envelope functions is different than the angle that the current value of t will provide when fed into the envelope functions. There is some complicated relationship between these which was too difficult for me to bother trying to figure out, esp. when I realized the examples of rosettes that I was trying to mimic did not actually use systems of spinning wheels. Nevertheless, guilloche11.pde is an example in which I tried to make this work.

next