Solved
Try a function like this:

Where the third argument (PointsPerCycle) can be a scalar or an array, that determines the number of points per cycle.
Here you see it called in both modes:

And the resulting plots are:

As you can see for the first cycle (15 points per cycle) the two point sets coincide.
For the second cycle there are more boxes than x-es, in the third and following cycles there are twice as many boxes as there are x-es.
Success!
Luc

