Rectangle false "packing" (Sample and example)

I try here to answer from a question on discourse

https://discourse.mcneel.com/t/fill-an-rectangular-area-with-predef...

Fill an rectangular area with predefined elements

https://discourse.mcneel.com/t/subdivide-given-area-into-randomly-s...

I add some difficulties to resist and to do it with Grasshopper and Anemone. I know it is surely more simple in C# or other program. Peter Fotiadis will be sad, but I did it in GH, it is quite long but it seems to work. The idea is to generate a grid of point, to take a random point on it, to generate a rectangle with a random incremental size (1, 2, 3, 4 in width and the same in height in my example) so look if this rectangle contains all the points of the grid, if yes put this rectangle on memory, destroy the points on contact and redo it until grid is empty. 

Load Previous Replies
  • up

    Andreas Walther

    Wow !!! thank you very much !

    I am downloading right now, cannot wait to try it out...

    I really appreciate your help !

    best regards

    Andreas 

    • up

      Laurent DELRIEU

      Here is the way to achieve an image like this : 

      You need some surfaces arranged like these ones, there a 6 types of rectangles 

      You need 6 types of pattern which have the same size/orientation as the rectangles above. In order to have closed surfaces, all curves must connect to each others, so there are with abcissa/ordinated xx.5.  here curves are in blocks (you need Panda Plugin), it wasn't mandatory but asked by Andreas.

      You have now to link the rectangles to the curves. It is done by hand with genepool. 

      Here the 3DM and GH for that, you will note than the edges are on 3dm file so the size of the sheet is limited, but could be change very easily. 

      3
      • up

        Iwan Mazlan - E

        Hi Laurent, 

        Thanks for this amazing work. 

        I have difficulty with the script. What I wanna do is, I tried to change the dimension of the grid from {1,1,0} to my own preference. Let's say to {0.15,0.15,0}.

        After changing the grid the script didn't work anymore. By any chance, this would be possible?

        Best regards,

        Iwan

        1