That looks amazing! Thanks for all the help, I’ll be able to learn so much from this example.
In terms of how I’d like the blocks to separate across obstacles, it might be clearer if I rephrase it as an optimisation problem where I am trying to minimise the total length of the strings (or equivalently the total distance between the box centroids and the anchor), subject to the boxes satisfying all collision requirements (between each other and with the obstacles), and all positioning requirements (centroids confined to lie the rail and box orientation aligned with local tangents).
Going back to the sketch, I have one anchor that I move from position 1 to position 2. When the anchor is at position 1, the leftmost box sits to the left of the leftmost obstacle, even though a “better” position for it would be to the right of this leftmost obstacle since it would be closer to the anchor. It doesn’t sit to the right because by doing so it would push the next box (to its right) further down the curve, increasing that box’s distance to the anchor by an amount that is even greater than the reduction of distance in the first box, and thus increasing the total distance across all boxes. It is only when I am in the process of moving the anchor from position 1 to position 2, and box 2 follows the anchor to the right naturally to minimise its distance to it, that allows box 1 to “jump” over that leftmost obstacle in its bid to minimise its distance.
I suspect that it might not be clear that the dashed and solid lines in the sketch represent the before and after “optimal” arrangements. I should be able to use the file you’ve provided as a starting point for developing this mechanism, nonetheless. Thanks again for the help!