Is there a way to nest the same geometry (a rectangle in my case) into the given polyline until there’s no place left?

I tried doing it with @Petras_Vestartas’ OpenNest by repeating the geometry and taking only the first sheet, but there’s a lot of excessive computation and I don’t know the approximate number that I’ll need.

@laurent_delrieu, I remember seeing some example of yours but can’t find it. Please help.