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)
Enjoy!
Hugh.

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!
Hugh.

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!
Hugh.

Saturday, January 30, 2010

Seifert surfaces


Hi folks! My next mathematical project comes from a suggestion from local knot-theorist Julia. The idea is to knit the Seifert surface of a trefoil knot. This will be very similar to a project (http://www.math.uchicago.edu/~mrwright/crochet/) of Matthew Wright's.

So, what is a Seifert surface? There's a theorem in knot theory that given any ('tame') knot, there is an orientable surface whose boundary is this knot. I think there's a good constructive proof of this, which also allows you to find out what this surface is. This surface is the Seifert surface of the knot.
If you want to play with them, there's a very cool program, "Seifert View", which will draw them for you (it's free, but sadly only runs on windows).

So, how to knit this? I think this should be pretty straightforward -- I'll start from the middle of one side, increase outwards to form a disc, then split into three to form the 'struts', before rejoining and decreasing to form the top disc. The magic is that before rejoining the 'struts' at the top, I'll flip them over to give the twist. When I'm done, I'll crochet around the edges to highlight the boundary knot. This way has the advantage of being seamless, though possibly at the expense of making the joins less neat.
I'm also considering threading some wire through this boundary, as Matthew Wright suggests, to give the shape rigidity, and then see if I can hang it as a decoration.

I'm planning to write up a pattern for this one, partly because it should be good and quick and partly because I need to get more practice with the LaTeX pattern formatting package I wrote. Since it's so similar to Matthew Wright's work, though, I'll have to ask him before I go publishing it.
I'm not sure how well this approach would generalise to other knots, I may have to ask Julia about that.

So, let's see how it goes -- should be good and quick, since it will be quite small.
Hugh.

Friday, November 27, 2009

LaTeX and knitting


Hi folks, we've been talking about this on Ravelry for the last week or so, and I thought I should really put it up here too.
The idea has been floating around for some time of writing a LaTeX package which will typeset knitting patterns, although exactly what it will do and how far it should go has been rather harder to pin down.

I decided to give this a go, and put something together. The idea is that it will provide you with simple commands which will provide a basic skeleton to your patterns using (very) simple commands, so you can just write your pattern without having to worry about the formatting, or even work from a template.
The class I wrote to do this is now at a testing stage -- I've got all the commands I thought would be useful, and I now need to see how this works for people writing actual patterns. I'd rather not make it *entirely* public just yet, so we're doing some testing in GeekCraft on Ravelry. If you'd like to try it out, go there and it will redirect you to the files and instructions and things.

The plan is that after a period of testing I'll collect some feedback, make whatever changes people suggest, then I'll stick appropriate "do what you like" copyright notices in it and release it into the wild. (I suppose I should write some proper documentation at some point too.)
I wonder if CTAN would take it? It *is* pretty elementary.
An important thing to note (and someone mentioned on GeekCraft) is that it should be pretty modify-able too -- since it's mostly dealing with style I'm hoping people will personalise it. Nothing in there is hugely complicated, it's mostly just a matter of tidying it out of the way.

So, if it sounds good to you, look out for it in the near future, and if you're on Ravelry you can come give it a whirl and let me know how it goes!

Relatedly (and coming out of the discussion of this, I was pointed to KnitML. I haven't read up on exactly how much it's capable of just yet so I'll write more about it when I understand it better, but it looks like an amazing project -- go check it out!

Hugh.

Monday, November 23, 2009

Blog note

Hmm, spam-bots seem to have found this blog today, so I'll put comment moderation on and see if it clears up at all. This in no way excuses you from posting comments, which is mandatory :op

Hugh.

Tuesday, November 3, 2009

Hand grenade


Hey -- just a quick post today, but I realise I haven't been updating this much, so I thought I should post some of the little projects I've been doing.
So, on a strange whim I decided to make a hand grenade. I wasn't too sure about this, because it must be pointed out that grenades are vicious and lethal weapons designed to kill people and destroy things. One thing I *didn't* know about them, until I was looking up information for this project, is that the little raised panels (on some grenades, not all have these) are designed to fragment into shrapnel on explosion, killing anyone nearby. I suspect their purpose is a bit blurred by their use in computer games and films, which naturally gloss over that kind of detail.

That said, they are a very powerful symbolism to them too which is quite divorced from this, about power, change and danger (I suppose the same goes for most military things), and that's more what led me to want to knit one. That and because I've been listening to Green Day's "She's a rebel" way too much lately.
The design is pretty simple -- it's a tube, with a bit of tapering at the ends. There's some (not terribly well done) stranding to give the 'panel' effect, and the top part is knit separately and sewn on. It doesn't have a pin, mostly because I want to be able to throw it (seriously, everyone should have at least one knitted toy for throwing at the tv) and, ironically, metal bits would be slightly dangerous for that.
Really it should be quite a lot squatter and more tapered, but it's very recognisable anyway, and the designs for real grenades do vary quite a bit.

So yeah, I'm pretty happy with how it turned out, the biggest concern was that the long-ish floats make the stranding a bit difficult.