Grasshopper - Count how many connection types

Hi all,
I have a list of structural curves and want to find out how many typical connections from the model.
What I could think of now is:

  1. Create spheres from nodes
  2. Intersect those spheres with the list of structural curves to count how many intersection points on each sphere.
  3. Create vectors from nodes to intersection points, do addition vector. Every node has the same addition vector length should be out put as the same typical connection group.
    But I have struggle at stage 3. (Or if you have any better method please advise.)
    Any help would be appreciate
    [model2forum.3dm|attachment]model2forum.3dm (135.3 KB) (10.0 KB)

I have trouble with “stage 3” too because I don’t quite understand what you mean? I suspect you are referring to the sum of distances to each node’s neighboring nodes?

This is based only on the number of connections at each node (3 to 7): (24.6 KB)

NOTE: Some of the curves are only 0.1 units long so when I increased the radius of the spheres for display purposes, those connections were lost! Hence, two sphere sizes are used.

(WOW! I struggled far longer with legend/display issues than solving the actual problem!!)

P.S. A visual inspection of the curves shows three of them (pink “pipes”) to be extra long, spanning three or more nodes: (29.6 KB)


You could use SandBox for topolgy question

Thank you for your gh., it’s quite close to what I am looking for now.
However, I did number the connection types by hand to show the final result that I expect.
It’s 12 typical nodes (12 different color nodes)
model2forum-withnodes-190810.3dm (207.3 KB)
At the moment, your gh. only counts how many points on sphere but I want to classify the nodes more detail as in image which will help to manage exactly how many connection designs should be done.

Finally, I found the way. Thank you for your idea @Joseph_Oster, I develop from your gh.

Can you post the code please? Would love to see how you did it but won’t bother reconstructing your model from screen shots. Thanks.

Here is the gh: (20.2 KB)

1 Like

Thanks for sharing your code, that’s a very interesting way of looking at the issue. Nice work!

Took me awhile to understand it, and I found myself rearranging your code in the process… I removed VMoments because those points were already available earlier in the model. And I removed multiplying vectors by 100 because it seemed arbitrary and unnecessary when the same thing(?) can be accomplished by changing the rounding precision (decimal points).

I rerouted wires to bypass panels instead of passing through them.

Then I got a little carried away, wanting to see a scalar legend (ranked by values instead of their order of arrival in a set) and bothered by so much reliance on the color gradient instead of color being merely a display feature. So I moved the CSet/MIndex pattern to before the Gradient instead of after it (light gray group below). (64.5 KB)

The “vectors” group has a switch to show either “Vec2Pt” (3, 4, 5, 6 or 7 per node) or “Vector Sum” (one per node).

Your internalized curve list (orange Crv param) is missing some curves so I used the curves from your original .3dm file instead.

LATER: Worried that sorting messed things up - oops!? (work in progress)

FIXED SORTING ERROR (?) Something still looks wrong… :thinking:
BUG FIX below retracted - Doesn’t stand up to visual inspection. Distractions, still wonder…? (52.2 KB) (DEPRECATED! use original version above)

1 Like