I everyone, I have been playing with Grasshopper for a little bit and I was trying to create an epicycloid using this simple definition.

So far, I was able to generate the points of the epicycloid as shown below.

Where I am struggling is to connect the points with a curve. I tried with the component spline>Interpolate but I got the a set of curves that connects all the points based on their index

I am more interested in get a curve like this:

I suspect the problem is that the interpolate is connecting points based on index number 1,2,3,4,5 instead of connecting the ones that are on the vicinity. I tried to sort but I did not get results I was expecting.

[epicycloid.gh|attachment]Does anyone has some advice on how to tackle this problem?

epicycloid.gh (7.7 KB)