Solve number of items on a curve (n) with n items and n-1 items?

Hi, I am trying to solve an equation to obtain the number of items that would fit on the curve by approximation.

There is a rythm of two items, the arch and the pier. The rythm is as follows:
Arch - Pier - Arch - Pier - Arch - … - Arch

This means that for every N arches, there are N-1 piers.

I know the length of the curve, I know the width of the pier and I can set a target width for the arch using sliders for both. However, I don’t know how to solve N in this case.

L = nArch_Width + (n-1) Pier_Width
With L = The length of the curve (=known), Arch_Width = The width of the Arch (=can be set by approximation) and Pier_Width as width of the piers (= known). How do I solve the number N?

I’ll do that



pillars arches.gh (10.8 KB)

Thanks! This works out well, better than I anticipated. I used to work with the item number and use a panel to display the length of the arch, but this method is more accurate across multiple curves.