Trying to rotate segments of a line array

Hi,

I am trying to create a definition, that splits an array of lines with circles and then rotates these pieces around the center point of that circle that cut it. But I am running into problems:

Problem 1: I cannot get the splitted segments of the lines to rotate around the corresponding circle centroid. Instead, they all rotate around one of the centerpoints.

I have tried various grafting, flattening, flipping, cross reference… combinations, and I have had various results. Actually I would say I have had almost all the results, except the one I’d like to have. :wink: But my trials are quite blind, I don’t understand very well what I am doing.

Problem 2: The results vary depending how the circles are arranged over the lines. To illustrate this, I connected a param viewer through flip matrix -component. If you drag any of the circles around, the param viewer will have 2-4 branches. What is this?

I am trying to make this work, but also teach myself about working with trees, lists etc. Can anyone point me to the right direction, please?

Rotating_ segments_of lines.gh (12.7 KB)
Rotating_segments_of_lines.3dm (41.6 KB)

Is this what you are trying to do?

Ýes! What is that PShift component and what does it do?

Thanks a lot!