Saturday, July 24, 2010

Linked list knitting

Bit of an odd project to talk about today (also, if you know me on facebook you may have seen this already.
The idea is to implement a system of knitting using linked lists. There have been quite a few recent experiments into knitting with unusual media, whether it's carrier bags, wire, human hair, or even fibre-optic cable -- you can knit with just about anything which can be made into threads. You could think of this as a really extreme version of this -- a linked list is essentially a thread of data, so why not knit with this? (Or you could see it as just a terrible pun being taken too far, which is probably more accurate.)
So here I've designed a system of knitting using these lists, and implemented it in C.

So, linked list is a data structure in which each data point contains the address for the next piece of data, so to read it all you start at one point and move along the chain following the addresses. I'll actually be using doubly-linked lists -- for these each data point contains two references, which means the chain can self-intersect.

To come up with a system of knitting using these lists, we need to be able to form loops, and to pass loops through each other. This can be done as follows:

This is really all you need to start knitting -- forming a loop corresponds to casting on, we know how to knit into a stitch, and we can cast off by simply threading the 'yarn' through the stitch without forming a loop.
It would also be possible to give analogues for many other knitting concepts -- you can purl by reversing the orientation when you knit, you could Kfb by passing two loops through the stitch, Make by simply forming a new loop in between stitches, K2tog by passing the new loop through two previous stitches, and so on.

So I thought it would be fun to actually implement this, and you can see the results here:
The first file contains the details of the implementation, the second is a set of instructions for knitting a small stocking stitch swatch, and the the third gives a 2*1 ribbed cuff knit in the round -- hopefully you will be able to see how these correspond to a real knitting pattern. (The final file is the header) If you're using linux you can compile these with the commands:
gcc tensionsq.c llknitting.c
gcc ribbedcuff.c llknitting.c
I'm not too sure what the equivalent command would be in Windows.
The output from each program gives the positions of the start of each stitch in the array, which isn't terribly illuminating, but hopefully convinces you that it's actually doing something. (I decided not to worry too much about outputting data since it's really the program which is the interesting part.)

So there you go -- that's how to knit with linked lists. If, for some reason, you wanted to do that. So, linked list crochet?

Happy knitting, and/or data structuring!

Friday, July 16, 2010

Aromantic comedy

Hey folks!
Lots of finished stuff still to post, but am excited about a project I'm planning just now, so I want to talk about that.

So, 'aromantic' is a term used in asexual circles to describe people who find they are not attracted towards romantic relationships of any kind. The theory goes that while a person can be not attracted towards any sexual relationship (asexual), they are often attracted to romantic, non-sexual relationships of various kinds, so 'aromantic' is a sub-classification of people who also aren't interested in this.

And benzene. Benzene is an organic molecule made up of six carbon atoms forming a ring, each attached to a hydrogen atom. An early proposed structure for this molecule had alternating single and double bonds between the carbon atoms:

This has the right number of bonds, so it would make sense, but X-ray diffraction observations show that all of the bond lengths were identical, which rules out this possibility.
In fact, rather than forming pairwise bonds between atoms, the valence electrons form a more complicated orbital between all the atoms, forming a de-localised electron ring, denoted by:

So, it's a pretty awesome molecule. And organic molecules which include a benzene ring, such as phenol and TNT, are referred to as 'aromatic'... you can probably see where this is going.

So naturally I want to combine the two things. The plan is to make a hat design based on the symbol for a benzene ring, but with the central ring replaced by a heart shape. There will probably be six smaller hearts around the edge, where the hydrogen atoms would be, too.
Practically, this will be a more elaborate version of the radial heart-hat I made a while back, although it will take some fiddly modifying to make it work out.

It's going to be *awesome*.
Hugh :o)

Monday, July 12, 2010

Juliana Hearts

Hey folks, I thought I'd posted this a while back, but seem to have forgotten to mention it here.

Last year, a friend from my knitting group, Juliana, died following a long wait for a heart transplant. We wanted to do something to remember her, and came up with this plan -- to knit a collection of little stuffed hearts and give them away as gifts to people. There are really two reasons for this:
First, I'm certain that Juliana wouldn't want people to be sad because of her, regardless of the circumstances. I think it's really a fitting tribute to her to give these gifts away, (hopefully) to bring some happiness to as many people as possible.
Second, we hope that by doing this we can raise awareness of organ donation. I really hadn't thought about organ donation until Juliana became ill, I'd always just put it off. So I really want to encourage people to think about it, to make a definite decision. I'd also encourage people (donors or not) to read the stories on the Legacy of Life website, they do a great job of showing the positive side of organ donation.

So, that's the project.
I've made quite a few of these hearts now, and they're mostly pictured here. I've also written up the pattern for the hearts, which is available as a free Ravelry download, in case anyone would like to make some for themselves.

If I can give you a heart, let me know! As I say, the aim is to give them as widely as possible, so this is really open to everyone. You don't have to be an organ donor, and you don't have to be not-an-organ-donor either, it's all about spreading the happiness.
I also have a bunch of the books from Legacy of Life, which have some really amazing stories and I would totally recommend, so if I can give you one of those let me know too.
And of course, do think about whether you would want to be an organ donor. Then tell people! Preferably your next of kin!

*Also*, how amazing is it that organ transplants are possible? Go Science!


Friday, July 9, 2010

Geoemtric Knitting II ... somewhat belatedly

Hi folks, I've just realised how long it's been since I've posted anything here, and I have a whole bunch of stuff waiting!

A few weeks (well, months) ago, I gave a talk in our PG Colloquium series on the subject of geometry and knitting. The idea was to show off a few mathematical knitting projects I've been playing with, and use them to illustrate some maths.
I'll write about the projects individually later, but in the meantime you can read the slides here:
Slides (pdf)

A couple of the projects used computer programs to calculate the patterns, based on inputted parameters. These programs are written in Ruby, and if you'd like to give them a try they can be found here:
Universal cover scarf
Cellular automata shawl
Hopefully their operation should be pretty clear, and is explained in more detail in the slides. If anyone's interested in knitting from these I'd be delighted to give some tips!

Also, thanks again to my Glamorous Assistant Pamela!

Also also, the Juliana hearts project is still ongoing, and open to all, so if I can send you one let me know. (Hmm, have I really not posted about that here before? More on that to follow then.)

Happy knitting, and more posts soon,