Loop or series to create step by step operation (points, curves, circles)

Hello All,

I’m trying to write a script that to my current knowledge requires copy pasting a cluster of components again and again for each step of this operation, and I’m hoping to create a loop or somehow attach it to a series components instead (or whatever suggestions you have) to avoid this time consuming method.

Here’s the operation:
I start with a curve and it’s start point:


I draw a circle from this point: (5mm radius)

this circle intersects with the curve

I draw a vector from this second point to the initial point:

this vector is then rotated 90 degrees

I draw a line using this vector (1mm lenght)

Now, by using the end point of this new curve, we will restart the operation, here’s the point:

I draw a circle from this point (this time it’s 6mm radius, increasing incrementally)

same thing, draw a vector back to the initial point

rotate 90 degrees

draw a line using the vector (this time 2mm length, increasing incrementally)

and then, repeat the steps, circle increased 1mm in diameter, last line increased 1mm in length:

(here’s how I sort the two intersection points (the circle and the curve), we are moving towards the other side of the curve)

and it goes on like this, to the end of the curve.



here’s the script with internalised data:
loopoperations.gh (12.2 KB)

How can I rewrite this script so I don’t have to keep repeating the cluster of components for each circle and curve? I would like to plug in only one curve and point, and get the same results, this operation repeating from start to end of curve.

Thank you!
Renan

Anemone, of course! Plenty of examples on this forum.
TLTR :bangbang:

1 Like

Yet another Anemone loop. Is this what you have in mind? I changed your code, hope I didn’t break your algorithm?



loop_2024_Jul12a.gh (16.1 KB)

2 Likes

Amazing, thank you so much Joseph!!

As you can see, the circles are in the ‘D1’ output. Maybe the last one should be ignored?

1 Like

Yes!