Weaving images

@Majicj continuing our talk from last night, I wrote a custom Makelangelo generator to simulate the thread patterns around your bicycle wheel that would generate an image. You said there were 200 pins around the edge of the ring, for 200*200/2=20000 total possible strings

Here’s what my sample looked like in the familiar spiral style:

http://i.imgur.com/9KsXrfR.jpg

Here’s my attempt to find the optimal string pattern. First I “weighed” every possible string. strings over dark parts of the picture weigh more. Then I drew the 10000 darkest strings.

http://i.imgur.com/CLZVRLS.jpg

Anyone have a better idea for an algorithm? Also: 10k strings is going to take an f’n long time to string up.

I might try “weigh all 199 strings from the here, pick the darkest not already picked, repeat.”

1 Like

Here is another attempt in Processing with a subtractive method - every time I draw a line on the left I subtract it from the right.

http://i.imgur.com/l1VBzFP.jpg

1 Like

Same again, but the end of one line is not the start of the next.

http://i.imgur.com/CjtddYN.jpg

2 Likes
1 Like

Been thinking about this a bit. Using Gauss’ technique there are exactly 19,900 unique possible lines from every point to every other point on a 200 point circle. (n= 199 as we are counting lines not points)

There is no real benefit of drawing a line from each point to it’s nearest 10 neighbours on either side. So this reduces the line count by 21 for each point (not all lines are unique). Again using Gauss’ technique we get a total unique line count of 17,900. This is a reduction of 10% which may appear insignificant but every bit helps when I’m going to be hand wrapping my first wheel.

As for your algorithm I am wondering of you could take the output image from the algorthm where one each thread IS NOT the start of the next and use this “generated” image as the input for the subtractive method where each thread IS the start of the next thread. It may look ok? Sort of a multipass filter if you think of it.

Anyways I plan on finishing my wheel loom construction and just trying it out with basic solid shapes (i.e. squares, circles, parabolas, etc) before I attempt to weave a portrait!

As a funny aside. I don’t recommend measuring 11/32" of an inch around a 22" bicycle wheel by hand and hope that you get exactly 200 points! Did not work for me. I was only off by 1 so not too bad. :slight_smile: So Fusion 360 and 3D printing to the rescue. A marking guide with a 22" diameter arc with a slot every 1.8 degrees to the rescue. Works like a charm.

2 Likes

a novel solution for the lines.

I tried both line-follows-line (A-B,B-C) and independents (A-B,C-D). The last image I posted is indepent lines. LFL is much faster to calculate and is arguably worse (second last).

Who did the art that inspired you? What algo did they use? Perhaps we can beat their method.

Petros Vrellis is the original poster for this idea. I came across this link via Hackaday.

The following is from his site

Pattern generation
The pattern is generated from a specially designed algorithm, coded in openframeworks (http://openframeworks.cc/ ). The algorithm takes as input a digital photograph and outputs the knitting pattern. Over 2 billion calculations are needed to produce each pattern; not much of a load for today’s computers, but definitely an impossible task for the human brain. So, this is a new and unique type of knitting that could not have been implemented a few decades ago, without computers.

He has not released any of his code. I’ve looked around a bunch for algorithms but have not found anything online.

Check out the Hackaday Comments section as there are a few interesting suggestions for algorithms.

One suggestion from user Michael looks promising. He did the Bob Marley test with html5 canvas + javascript

Process, simplified:

  1. create a small reference image (for example 200×200 pix, a bigger one will not produce better results)
  2. create a stack of all possible lines between the pins (in my example I don’t want lines between pins that are less than 30 pins apart)
  3. pick a random starting point
  4. try all line options from this point according to the stack, calculate which option has the lowest total pixel error compared to the reference image
  5. draw the line, and remove from stack (both ways, because I don’t want the same line used twice)
  6. repeat 3000 – 5000 times

And another implementation one the comments Section https://github.com/wose/Strixel

Updated the algorithm in github. Looks a lot better now.

1 Like