Polar Array into Lines via Series Problem

Alright, I have a fairly complicated bug.

The main part of my program creates a list of numbers, all positive and above 3, defined by a sinusoidal wave. The higher the maximum_sides, the higher the maximum number in this list. The program the uses a polar array to create 30-40 shapes on top of each other - each shape will be given an amount of sides that is defined by the sin wave pattern.

Now, I clearly have made a mistake in my coding. I created a simple tool to make 2 series; one of all the points in a layer, and one of all the points in a layer starting at 1; these series represent the start and end point of the lines. However, I set the count for these series to a different variable that is not supposed to be for the count. This number only went up to 30 - essentially, if a layer was supposed to have more than 30 sides, the program would not draw that many sides, resulting in a fragmented building - you can see this in the two photos.

So, my line of thinking was to take each individual number from the sin wave list, and use that as the count for each layer - however my attempt clearly failed (referencing the last pic).

I am not sure how to fix this problem - could someone suggest advice?

For reference, here is the code before my attempt to fix it:

2019.02.11 Attempt 5.gh (36.0 KB)

Here is the code after my attempt to fix it:

2019.02.11 Attempt 5 attempt to fix.gh (43.6 KB)

Not sure this is what you want and I didn’t look at the details of your definition, BTW, IMHO, what you want to do can be easily accomplished using other methods including the attachment.

2019.02.11 Attempt 5_re.gh (45.6 KB)