generative modeling for Rhino
I´m new to grasshopper, and I´m trying to make a program (that's how you call it?) with grasshopper which can arrange defined areas (rectangles basically) through galapagos, by following a chart of area relations (this chart represents which area goes nearer which area, for example, architecturaly talking, a bathroom should be near a bedroom and a kitchen near a dinning table).
First step is to cluster everything together, so what I did was make a bounding box of, for example, 3 rectangles, and "minimize" the area of the bounding box (through galapagos), being sliders of movement for the rectangles the genomes. That works ok but I need it to check if the rectangles touch each other so that in the solutions they dont overlap.
And that's where I'm stuck right now, so my question is if any of these aproaches to "collision detection" is possible:
1- Subtract a 2d domain from a MD slider (parametrically) so that the rectangle doesn't move in the subtracted area.
2- Check true if a 2d domain contains coordinates from another 2d domain (which would mean collision) and if so, how could I eliminate these colliding solutions from the best galapagos solutions.
The point is, that i don't want rectangles to overlap, or at least to detect when they do.
Hope I didnt bore you with my long post, and thanks in advance for any help.
Could I represent a domain as coordinates, and not just numbers? so I could just check if any coordinates from two different rectangles are the same and this I could minimize to 0 in galapagos.