# Reciprocal

I saw an old thread of yours with kangaroo 1 about Reciprocal frames using pipes:Reciprocal structures - example definition - Grasshopper

Is there any example on kangaroo 2?

In the example sticks also slides too much. Could you give any recommendation how to setup Reciprocal frames?

I read few papers from Peng Song.
The rotation of edges by average normals is clear for me. But how to overlay sticks cleanly not so clear:
I tried to rotate lines by line normal plane, but it is not physically correct. So I assume there must me some iterative way to shift lines.

2 Likes
2 Likes

As for stopping them sliding too much - adding some very weak anchors is one way that can work if you start out reasonably close to where you end up.

It should be possible with springs as well, though it gets a bit complicated adding points along each strut and keeping them straight.

I guess the ideal would be another goal similar to this line-line one, but instead of pulling together closest points it pulls struts along their axes to make a point at a given parameter on one meet a point at a parameter on the other. Potentially with the possibility for this target parameter to shift along in a plastic manner.
This is similar to something Iâ€™d thought about before for friction in knots/weaving.

Thank you:)

I am wondering if line line goal could keep attracting closest pairs of lines too not only using repulsion. When lines radius is too small it would pack them.

Thatâ€™s exactly what the scripted goal in that definition is doing - the standard line-line goal checks if the cylinders overlap, and only applies the force pushing them (to the distance at which they would be tangent) if they do. To make it do attraction as well, I just skipped that check, so when theyâ€™re too far apart it pulls them back together.

Thanks, it seems I chose collision pairs in a wrong way. I tried to collide all adjacent line pairs but it must be two pairs per line segent. - > two goals per line. Now it works perfectly:)

Dear @DanielPiker,

Would it be possible to have a goal that attracts lines only?

In the image below, the black lines identifies two closest points between each line, that I can get as an input. But I have no idea how to pull those 3 straight lineS so that black line length becomes zero (The orientation over/under is not important):

Hi Petras,
I think that should be possible by setting the radius to zero in that last definition I posted.
(This will still allow the lines to slide along each other)

Also, with zero offset Iâ€™m not sure how much curvature of the overall surface will be possible. I guess the hexagons can be non planar, but I canâ€™t picture how it would allow positive curvature without the rods bending

The issue is when it set to 0 it slides too much:

Would it be possible somehow only to attract but not slide? To attract to initial line closes point.
Even the curvature will be totally flat afterwards for the second point you mention.

LineAt_to_LineAt.gh (13.6 KB)
Hereâ€™s a new goal that pulls a pair of lines together between given parameters on each

1 Like

This is a very nice goal, thank you

1 Like

Dear @DanielPiker

I am here again with reciprocal question (two questions).

This time I would like to ask question about reciprocal component of yours from kangaroo1
My original intention was to extend this component to polygonal meshes, here is my trial (it uses my rhino6 mesh library):

ReciprocalUsingNgons.zip (779.8 KB)

The way I did is taking an outline of polygon and colliding them with current and next line segment.
Solution seems fine, but I would like to ask how did you defined pair in your component the line pairs for the collisions? What is the logic behind? Also how you define the rotation normal? I tried to use average of two mesh vertex normals but it seems to produce different results.

The second part is over-under logic.
From edge to edge both in yours and mine I see that some sticks are not resting on top of each other, but can fall out. How can I avoid this issue? Would it work only on specific mesh typologies only?

1 Like

Hi Petras,

The pairs of cylinders to keep in contact came simply by pairing each halfedge with its next.
For the axis to rotate about I used a line through the midpoint of the edge in the direction of the average of the normals of the 2 adjacent faces (I guess if you are using general polygons the normal is not so uniquely defined as with triangles, but I think any estimate should work here).
This part is similar to what Tomohiro Tachi used for generating tensegrity structures in this paper:

As for the over/under - yes itâ€™s true that this approach doesnâ€™t always result in all sticks resting on each other in a way that it could work just with gravity and friction. Iâ€™m not sure if that is always possible with straight sticks for general surfaces including negative curvature.
Still, this isnâ€™t necessarily a problem if you are actually connecting the sticks - they can still transfer in-plane and bending forces through the structure - in the little dome we made we used cable ties.

Dear Daniel,

Thank you for response.
Does it simply means that the edge rotation vector is as image below - average vector between â€śAâ€ť and â€śBâ€ť:

I have a question about under over part again, does it the kangaroo goal flips the sticks as gif below, because geometrically after scaling the lines change over-under position, or particles slips over each other? I attach the sample file, where I move the slider a little bit. If the particles are slipping out of its place, I am wondering if it possible to make it constant to original position?

RotateEdgeExample.gh (26.6 KB)

Yes, the direction of the rotation axis I used was just the average of the adjacent face normals.

For problem of them slipping past each others ends, I think maybe this could be solved most simply by just making the sticks longer for the purpose of the cylinder tangency goal. It doesnâ€™t matter if they then intersect with other sticks, since you are specifying explicitly which pairs are supposed to interact.
You could then select some portion of these longer lines to use as the actual sticks.

Dear Daniel Piker,

Making sticks longer does the trick.

I have question again. Or more a request for for a custom goal.

In screenshots below you can see that some values of sticks radius works very well, but when the radius is bigger, sticks slides too much, distorting the pattern. This means that thicker sticks requires higher curvature. I attach the script below.

HexReciprocal190222.gh (25.3 KB)

Is it possible to make the goal that is similar to LineAt_to_LineAt.gh goal you made before, but I would to ask an additional input for specifying radius. The reason for asking this is that I think sticks could rotate between each other instead of sliding. Thus changing the curvature in overall geometry.

Hi Daniel, for some reason this file is not working, even after pushing the reset button, I am trying to make a reciprocal frame but the reciprocal tool that was posted in grasshopper 3d is not making regularly shaped frames, can you help me please?
in case there is no solution for that, here is the code that I got from grasshopper3d, how can i attach an anchor tool to it so that the frames donâ€™t slide?
thank you
reciprocal test.gh (9.4 KB)

Hi -

I think the error you are seeing is probably caused by the wrong assembly reference being set in the scripted goal.

It needs to be the same one that Grasshopper is loading, from the same file location. For Rhino 5 this is the usual Grasshopper libraries folder, but for Rhino 6 it is usually in:

C:\Program Files\Rhino 6\Plug-ins\Grasshopper\Components

Hi Daniel, You are right, grasshopper asked me for a reference and I think I referenced it wrong, how can I retrieve the menu where i can relink where it loads kangaroosolver.dll from?

also, Iâ€™m going to be straightforward with you, I really need your help, Iâ€™ve been trying out grasshopper tools for weeks and I canâ€™t seem to get regularly shaped and lengthed reciprocal frames, could you please kindly tell me what do in order to get it? Iâ€™ve tried looking through your older posts but Iâ€™m just lost, I would really appreciate it if you could help me soon. (I have kangaroo 1+2, weaverbird, reciprocal tool, plankton and mesh pipe plug-ins).

reciprocal test 2.3dm (63.2 KB)

Iâ€™ve been trying to achieve this level of regularity (donâ€™t care much about the pattern choice though)

All respect,
Felis

1 Like

Have a look through this related thread: