Creating rectangles from a divided curve

Hello,
Could you please attach the gh file?