Grasshopper

algorithmic modeling for Rhino

I need to remap rectangles inside bigger rectangle (act as a domain) but with the three conditions:

  1. All rectangles to be attached in minimum space (minimum region union area).
  2. All rectangles to be INSIDE the boundaries.
  3. No intersection between rectangles.

P.S. you will notice a fixed rectangle without control from Galapagos.

Views: 1073

Attachments:

Replies to This Discussion

To find good results you need to know the functioning of the internal parameters of galapagos. 

Although in this case, would be better to use kangaroo.

Attachments:

Thanks Daniel

that's all I want. It's working.

can we find a way to start Galapagos even if there's an intersection (value 1000000) and when he run adopts achieves the rule.

How about this? I made sure to set the thing up in such a way as to make it impossible for the boxes to exceed the boundary. Then I measure the area of the individual boxes and the region union, and if there's a difference it gets multiplied by a million and used as a penalty in the fitness function.

Attachments:

Smart and simple, thanks David,

could you please explain the expression 

Area + 1e6 * (Total - Union)

specially 1e6 

thanks for your time and help.

e-notation or scientific notation is used to easily denote very small or very large numbers. The 'e' stands for 'exponent' and it means (in this case):

1 * 106

which equals 1 million.

The fitness function encodes the notion that we want to minimize the Area, BUT if there's a difference between the total and the unioned areas of all rectangles we have overlap and we heavily punish overlap by multiplying it by 1 million. If none of the rectangles overlap, then Total and Union are the same number, and we add 1e6 * 0.0 , which is zero.

thanks again.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service