Show HN: Browser-based knitting (pattern) software (github.com)
Right now I only implemented on simple pattern: Sophie scarfs. After knitting one that came out somewhat … asymmetric, I decided to just write some software to help me (1) easily adjust the length/width of the scarf (using Bézier curves), and (2) keep track of which row I'm on (so that I can make sure I apply increases/decreases at the right places). In the future, I expect to extend this with many other knitting patterns for other types of items.
The application is 100% browser (JavaScript, tested in only in Chrome in Linux/Android) based (no server-side component): all state is kept in the URL hash. I've used it to knit two scarves, including https://github.com/alefore/knit/blob/main/images/000.jpg.
The current state of knitting patterns is far from optional, stuck in pre-computer times. Perhaps knitters are not the most technically minded group. Most knitters just download patterns as PDF files. These files will show multiple numbers from which you should choose one depending on the size you're knitting, saying things like "Purl 24 (32 38 42 50 64) times" (you're supposed to pick the right number depending on the size you're knitting). They'll say things like "repeat rows 4 to 6 sixteen times".
I think software can display patterns much better (including not being limited to a few pre-selected sizes, but letting you choose the _exact_ size you want, and adjusting everything accordingly), and keep track of your progress much more easily. For example, for my scarf, the user inputs the desired number of rows (based on the desired length, which makes the pattern agnostic to the needle size), and the software computes where to apply increases/decreases.
I have many other ideas for improvements (e.g., track how much time I've spent in each row, show a clock), but I figured I'd share this early and ask for feedback. Hopefully there are other fellow knitters in HN. :-) Check it out and let me know what you think!
30 comments
[ 73.0 ms ] story [ 230 ms ] threadAny interest in expanding the scope of this to include other designs? Double knitting? PRs welcome?
I happen to be knitting a double-knitting blanket right now, my first double-knitted project, haha. I was actually thinking yesterday that it would be super neat if we could just feed it a black-and-white image and have it generate the rows. ... just haven gotten around to it.
But, yeah, if you look at the implementation, you'll see that everything is fairly generic, and the only parts specific to sophie scarfs are contained in a single file: https://github.com/alefore/knit/blob/main/scarf_pattern_fact...
That said, I expect the pattern class will need some improvements to be able to accomodate double-knitting (e.g., for visualization and such).
(You can swipe left/right to change rows on mobile; though your suggestion still stands. Just mentioning it in case it helps.)
Another program I made (and unfortunately lost) was one to generate bespoke sock sizings (and corresponding pattern instructions) from measurements I put in.
- KnitCompanion is a complex but extremely powerful app to take PDF patterns and turn them into very efficient, effective digital patterns. You can designate specific steps, walk through steps and charts with voice control, extensively reformat a pattern, etc. I use this for all moderately complex knitting.
- TinCanKnits is a pair of pattern designers who have recently released an app for their own patterns that customizes the pattern (showing only your size, changing chart colors to match your yarn, etc.)
- CustomFit by Amy Herzog is a tool with a collection of sweater designs that can be fully customized to your own gauge, measurements, design preferences, etc.
- There are a number of calculators out there for sock knitting (how many stitches/rows for heel flap, gusset calculations, etc.).
But in the example in your Github, was does "2K KFB 6K WYIF 3SLP" mean? The explanation is "The rest are the steps for this row.". I don't understand. Can somebody explain?
Mouse over each abbreviation and you should see a tooltip. This specific row would mean "2 knit, Knit Front Back, 6 knit, with yarn in front 3 slip."
This may also help: https://en.wikipedia.org/wiki/Knitting_abbreviations
I sometimes print something like "8(K P)" where I think putting the number in front makes more sense. But yeah, I think if there are no parentheses, I should just print it as you suggest.
Thank you!
Syntax like this is probably why wartime censors disapproved of mailing knitting patterns.
EDIT: someone needs to write a short story procedural in which the plaintext turns out to be a knitting pattern.
Supposing we suspect this pattern to be a coded message[2], let's take our given (data) and strip out the stop words:
24 32 38 42 50 64
if these were straight ASCII values, we'd decode to '\x18 &*2@', which maybe means something under a whitening transform, but we have a big clue that we ought to look elsewhere: in real, uniguous, knitting patterns, the number of stitches has to continually increase[3,4].
That suggests we should look at the differences[5,6] between the values:
8 6 4 8 4
and of course we'd want to take the entire "knitting pattern" into account when guessing[7,8] how to interpret this, but just for didactic purposes let's say in one potential decode we threshold at n=5, assigning 0 to high and 1 to low, and interpret the result in ITA-2[9](why?): we get 00101, decoding to 'S'.
That may seem like a lot of work to get one character, but we're no longer in an age when "01 if by land, 10 if by sea"[A] will go unnoticed, and the technology is dual-use: the same tricks used by a spy to push messages through below the noise floor can also be used by a space probe, to communicate during one's Voyage.
Lagniappe: even if you're not sending coded messages to someone halfway around the world with knitting (or fibre arts[B] in general, or...), they're an excellent way, during meetings that could've been emails, to get something productive done.
[0] https://en.wikipedia.org/wiki/Covert_channel
[1] compare essence and accident in philosophy; how far back can we push the notion that essence communicates zero bits and accidents communicate some positive (rational) number of bits? Compare https://en.wikipedia.org/wiki/Succinct_data_structure
[2] eg, if you are sending text which looks like english gobbeldygook with idiosyncratic capitalisation conventions, and all sentences are 13 words long, it would look as suspiciously framed as if a message consisted entirely of 5 word sentences.
[3] Exercises: why do animal calls (whalesong, birdsong, etc.) often ramp in frequency? (1 pt) what was the chinese notion of the language of the birds, and how does it relate to other spoken languages? (essay, 5 pts)
[4] that's to first order; we could get fancier with second and higher order analyses to see if our putative knitting pattern has any hope of creating a closed physical object, etc.
[5] God made Nat, all else is the work of People?
[6] from here we can go into calculus, but that's a different topic...
[7] early digital computers were built for ballistics, cryptanalysis, and explosive simulation. Despite all the bossware, we should be proud that we've managed to find other uses for them in the eight decades since.
[8] it really helps when guessing to have a known plaintext; Körner has some interesting stories about how the teutonic tendency to Ordnung muß sein helped the allies during WWII. Eg. most military comms won't decrypt to "new phone who dis?".
[9] https://en.wikipedia.org/wiki/Baudot_code Exercise: which coded messages decode to the same glyphs in ITA2 and MTK-2? (example: 1 pt, full set: 2 pts, do either of these relate to keyboard layout? 0 pts)
[A] do crochet and knitting also differ by number of needles?
[B] compare https://en.wikipedia.org/wiki/Quipu
If you're a software engineer, I think it scratches a lot of itches:
1. Knitting patterns are sort of like a tiny little programming language, with loops (as in iteration, not as in, uh, loops of yarn) and choice.
2. Knitting charts are a lot like pixel art.
3. There is a very fine-grained skill progression where you can ease your way in by starting with simple patterns that only use a few techniques. But there is always a next level of skill and challenge. The lore is incredibly deep and there is a ton to learn. You'll never run out of ways to improve your expertise. At the same time, even as a beginner, you can make objects that are useful and beautiful.
4. If you're tired of staring at a screen and crave something tactile, it is an excellent counter-point. It's extremely tactile, hands-on, and texture-oriented. It just feels good to knit or play with yarn and textiles. There are so many rich colors and color combinations at a level of vibrance that a screen never attains.
5. If you're mentally tired at the end of the day but still want to feel like you're making progress on something meaningful instead of just scrolling on your phone, you can always pick up a project and knit a few more rows without needing a lot of brainpower. At the same time, you can also choose projects with enough complexity that it doesn't feel totally mindless like a coloring book or something.
6. Unlike software where much of our output is intangible and meaningless to the world, everyone can see and appreciate knitted objects. The things you make are instantly beloved and appreciated.
7. If you are introverted and prone to anxiety, knitting is a very nice therepeutic escape.
I highly recommend it.
Being a long time knitter and also a designer (not a professional designer, but just someone that likes to design her own patterns and doesn't like to follow other patterns), I did several knitting tools using LibreOffice Calc (may be you can call that "old school"), you can download them here: https://www.aiguilles-magiques.com/-Outilsde-creation-?lang=... Sorry but they are mainly in French. Well, the sweater calculator is in English too.
For these tools, I just ask the knitter to enter the gauge and, yes, all the necessary measurements. The sheets make all the maths. Obviously there are way perfectible, and they don't show the shape of the finished as you did for your tool (notice the picture on y tools were made with Inkscape).
All this tools are under licence CC by-sa.