Thursday, February 25, 2010

Settlers of CTAN

Hey folks!

Back in November I mentioned a a LaTeX package I was working on for typesetting knitting patterns. I left this out for checking for a while, and finally got around to tidying it up and submitting it to CTAN. It's all up and running now, and you can download it here:

Knitting Pattern class

It works by providing a collection of useful commands which should automate all of the layout features you're likely to need in writing a knitting pattern, so that you can just write the pattern rather than desktop publishing. I won't say too much about that here, since it's all explained in detail in the documentation (and I've spent way too long reading that today).
Copyright-wise, I put it under the LaTeX project license, which seems to mean you can use it, distribute it, and modify it to your heart's content. You're also explicitly allowed to sell patterns produced using it. So if you've been thinking about writing up some patterns, give it a try! You'll need some familiarity with LaTeX, but it's very easy to pick up, and hopefully the sample template I included will make it all pretty self-explanatory.

While I was at it, I came across this other package, which produces knitting charts in LaTeX. I haven't tried it yet myself, but it looks pretty interesting.

(pictured is the CTAN lion, drawn by Duane Bibby)

Saturday, February 20, 2010

Universal cover scarf

Hi folks!

Continuing the mathematical theme, my next plan is to knit the universal cover of a punctured disc, arranged to make a ruffly scarf.

So, what is a universal cover? The idea is to take a space, and form a new space which is locally the same, but in which any loop can be shrunk down to a point. This is useful because when we try to extend local properties of spaces to global ones, it's usually these kind of loops which cause problems.
As an example, consider a disc with it's centre missing, the `punctured disc'. A loop in this space can be shrunk down to nothing provided it doesn't wrap around the hole. To remove these loops, imagine we take an infinite number of these discs, and declare that a path which crosses the x-axis in a clockwise direction moves one disc up the chain, and if it crosses anti-clockwise, one to the right. Now if we take a loop in this space, if it wraps round the centre point we've moved up or down the chain, so the loop is no longer closed. Then any loop in this new space corresponds to a loop on the punctured disc which doesn't wrap around the hole, and can be shrunk to a point. This space is called the universal cover of the punctured disc.
Another way to see the same space is this -- take an infinite sequence of discs, each slit along the x-axis. Glue the top edge of each slit to the bottom edge of the slit on the preceding disc. You can then stretch this out to make a sort of spirally chain, which I think would make a neat scarf.

So, how to knit this? If you imagine following a circle around the origin in this spirally chain, it will form a helix (assuming you've `stretched' the same way I have, this isn't entirely fixed) in space. My plan is for these helices to form the rows, working from the outside in. Of course, since I don't want my rows to be infinitely long I'll only have a finite number of discs in my chain.
One of the cool properties of helices is that it's quite easy to calculate their lengths (which is really quite rare among curves). Since the space is symmetric under shifting along the axis of the helices (after a suitable rotation), it's then just a matter of working out how many stitches to decrease in each row and spacing these evenly along the length. This is the same problem as knitting surfaces of revolution (see also), and it will be easy to adapt the solutions from there.
The actual maths I'll carry out using Ruby, this seems like the kind of problem it's very good at.

I should say too that I'm fairly sure this kind of scarf already exists, though without the mathematical intent. Must make sure to look around and see if I can find some links to compare with. I'm hoping that not being flat will make it nice and warm, but will have to see how it stands up to Edinburgh's winds.

Happy knitting, and/or calculating!

Wednesday, February 3, 2010

Dennou Coil

Right, the first attempt at the Seifert surface is done, and is now languishing while I try to work my camera. In the meanwhile, here's another quick project:

Dennou Coil is an anime series we've been watching at our animation society. It's based around a group of children playing with augmented reality glasses. The glasses have lots of useful functions, they act as phones and maps, as well data functions and virtual pets. It's a lovely, well thought-out series with great characters and a nice level of quirkiness.
One of the quirks is a piece of anti-virus software which crops up a lot, named "Satchi" (short for "Searchmaton"). This is embodied as a large pink blob with a happy smiling face, which tries to reformat everything suspicious it comes across. In the context of the series Satchi is supposed to be quite scary, since he's quite indiscriminate in his formatting, and the children spend most of their time playing with bugs in the game so they're usually in the firing line.

So, I'm planning to knit a Satchi. The structure is fairly simple -- he has a pink blobby body, with a smiley face design at the top. He has two large, spindly grey `hands', and four spheres embedded in his front. I'm hoping to make the spheres removable (in the series they can detach and move autonomously), but I'm not sure how the fastening for that will work, so they may have to be fixed.

Boku Satchi!