Knitting patterns on a surface in Grasshopper
Last week I have been visiting my brother in Barcelona. Maybe I should blame the maritime environment if I started experimenting with knots and threads. So, what I am going to show you today is a method to digitally knit yarn in Grasshopper. A similar definition to make a chaining fabric is provided at the end of the tutorial as well.
The stockinette stitch pattern
Download this Grasshopper definition (Update for GH 0.7+)
We are going to model the common stockinette stitch pattern at first, because this stitch can be easily adjusted to other knitting, chaining or weaving fabric compositions.
- The Grasshopper file starts from a straightforward definition of a knitting tile made out of curves, a surface and some parameters. This tile is illustrated in the picture above and is exactly the one marked in the dashed “component” box. The tile is surrounded by a rectangle in the grasshopper canvas, so that you can quickly adjust it to other definitions, in case you should need.
- A containing box is created, departing from the input curves. We are particularly lucky this time, because the open part of the curves can be exactely used to define the boundary box.
- This tile of curves is then repeated on the surface using the surface morphing component of Grasshopper, which is particularly useful because it maintains the geometrical continuity of what is being positioned.
- All curves are joined and rebuit using a custom-written C# method.
- The piping component finally produces the pipes.
Chaining pattern
Download the chain definition (Update for GH 0.7+)
By minimally modifying the previous definition, we can obtain a series of chains on a surface. It similarly works with one tile, which is then copied on the surface. We could expand this definition by making each newly formed link (a closed curve) periodic.
May 22nd, 2009 at 7:12 pm
wowow i wanna make the same for my shiny knights chainmail, this really rocks, thank you so very much for your good manual!!
June 12th, 2009 at 3:38 pm
hey my pleasure
August 11th, 2009 at 6:14 pm
oh wow, this is definition is deliciously elegant… I tried scripting a crochet pattern a few weeks ago but mine’s so primitive by comparison! Thanks so much for sharing
August 16th, 2009 at 9:31 am
nice one…
November 6th, 2009 at 2:33 am
That’s gorgeous. Thank you for sharing.
November 7th, 2009 at 12:10 am
Thanks a lot man. As Walter Sobchak once said, the beauty of it is in the simplicity.
May 13th, 2010 at 11:05 am
Beautiful!
I do have a question, I am trying to populate a surface with a non square base in a chain , but my definition is using a box, so i cannot intersect my components. I want to have a chain like yours but generated with my individual component, how can i make it?
thanks for sharing!!
May 13th, 2010 at 7:38 pm
Hi Marishk, thank you. I think it’s necessary to see a little sketch or examples to understand what you are trying to do… Have you thought about maybe opening a discussion on http://www.grasshopper3d.com ?
May 14th, 2010 at 11:35 am
hey, i really love the definition! i’m working on a similar issue on my school project and this really was an eyeopener!
there is only one thing i don’t get. What’s the purpose of the C# rebuilding script in the end – can i skip it? because if i try to offset the outcome line instead of piping, i noticed, that gh does not offset the whole line, at one end of the original line the offset is missing, but if i offset the lines before applying the C# script, it works just fine and the offset really matches the original!
so my question would be – is it really neccessary to apply the script if i’m not piping but offsetting and later on lofting… Can you explain the script?
and another question : how would you change the issue of all the knots having the same height – i see they are controlled by Z interval. Is it possible to somehow variate this interval – perhaps whit a guideline curve on the surface i morph on? any suggestions ?
just to give a taste what im working on:
http://s3.amazonaws.com/data.tumblr.com/tumblr_kx4lnvK4S71qb13sio1_1280.jpg?AWSAccessKeyId=0RYTHV9YYQ4W5Q3HQMG2&Expires=1273919699&Signature=f4CJzm0YXUmGq7gfvygX%2FIl4fnc%3D
Johan
Vienna, Austria
May 14th, 2010 at 6:46 pm
Hi Johan, the rebuild script is there because this definition is a bit old already, and at that time there was no “native” Gh curve rebuilding component. Adding to that, the piping was a bit less robust back then, so it would now and then fail. In the newer Grasshopper the script is not necessary any longer (try replacing the piping component and you’ll see it has more options now).
Variating the Z interval is actually difficult… the curves do not coincide any longer if two adjacent intervals are not the same, or extreme care is used in choosing these intervals and positioning the curves. There might be a couple of working cases I guess, but only with curves, points and single surfaces.
Thanks for linking to your work: it looks great (and somehow “Angewandte”? :) ).
– Giulio
May 14th, 2010 at 8:33 pm
studio prix ;) the “braiding” you see in the landscape is actually manually done in maya, so the next move would be doing it parametrically correct in GH :)
thanks for the reply – will give it some effort over the weekend and hopefully show what i come up with.
– johan
August 14th, 2010 at 9:42 pm
tanks it helped me alot
December 28th, 2010 at 8:45 am
Beautiful, parametric piece.
May 15th, 2011 at 8:09 pm
Hi Giulio,
I’m relatively new to GH and don’t quite understand where the points (P input) come from that create initial surface definition. Are they the points that are defining the pattern curves? In other words, how is the S input of the surface morph created? Thanks a lot! I love the definition.
May 19th, 2011 at 10:58 pm
Hi Matt, those points are just referenced by coordinates in Rhino (meaning they do not reference an ID, I just drew the logic there). HIH, – Giulio
June 14th, 2011 at 8:33 pm
Thank you. The work you do is incredible.