Adding thickness to curves depending on Length


I have currently obtained a proximity network for an area in grasshopper. I am now wanting to change the thickness of these curves depending on the length of the curves (eg. if the length of the curve is less than 5 than the curves will be thin. If they are larger than 5 in length they will be thicker).

I have arranged the lengths of the curves in order but am struggling to break the list into two inorder to add the different thicknesses and then convert the number back into a curve to be shown in rhino again.

Please let me know if anyone is able to help

Some tips:

  1. A prox Graph, or ANY Graph in fact is described (if we forget Islands) by a List of Edges (E) AND a List of Vertices (V). The way that these are connected is a matter of Connectivity Trees of Type int (notably VV, VE and EV - in real life we rarely use EE). Paths have 1 dim or 2 dims (case Islands). For instance an EV Connectivity tree has paths where the 1st dim (no Islands) or the last (case Islands) is the index of an Edge (in E) and the items are the indices of the related Vertices (in V) … blah, blah. Meaning that an EV has always 2 items per path.
  2. So given the E List you can extract (on a 1:1 basis) the Lengths in a List (say the L) and them find the Lmin /Lmax. Or … you can use Attractors (any List of pts, crvs etc etc) and some dist mode (push/pull).
  3. So for your Pipes you just Loop into E (and at the same time into L) using some sort of formula for the radii, say, LCurrent/LMax * some user variable. Meaning that your List of Pipes is 1:1 to your E List.

Thank you for your reply! I am trying to understand but am still struggling… are you able to let me know which components to use in grasshopper?

If you post your geometry you’re more likely to get GH help.


Bad news: I don’t work with components (at all) nor with any add-on (other than K2). If on the other hand you think that a C# tht does prox graphs (+ connectivity) could mean anything to you … notify.

See a rather entry level C# (out of many) that does prox graphs (as trusses) using Meshes as rnd Pts containers. Spot the classic output: the 2 Lists (V, E) mentioned and the 3 Conn Trees (VV, VE, EV).

Plus … well … the paramount Vis conn C# (what is connected to what).

Plus … the also paramount weak (non rigid) connections detection (remember: the Graph is treated as a Truss for real-life AEC puproses).

Please see my geometry attached. Please let me know how i can add thickness to the lines depending on the length
Grasshopper help.3dm (4.7 MB)

Thank you so much for this! Unfortunately I am not familiar with c# :frowning:

Funny saying that : EVERY component that you use is made that way. The only difference is that the component is a closed box (you can’t edit anything) while the C# is exactly the opposite. But … well … one can argue that the component is kinda a word in a language thus you can combine them etc etc (for me this means nothing).

Maybe this helps. I noticed you have lots of duplicate lines, so I culled them; it’s up to you. For the line thicknesses I used the Preview Lineweight component from the Human plugin.

thickness by (457.8 KB)

This is fantastic!!! This is exactly what i was looking for. Thank you so so much for your help!

Hi Ethan! Just looking at this again, would there be a way to alter the script to apply three different thickness to the curve lengths depending on lengths instead of just two thicknesses?

Hi Emily, here’s a method you should be able to generalize to as many thicknesses as you want, which relies on Find Domain.

thickness by (460.7 KB)

That is brilliant! Thank you so much. I hugely appreciate it.