# Dynamic building sizing composed of 2 rectangles with fixed area

Hi,

I am trying to create a script which creates random building shapes composed of 2 rectangles like in the figure below:

I would like to keep a fixed area of rectangles, change their width and length and move rectangles maintaining their intersection.

I found some topics about sizing rectangles: Dynamic rectangle sizing - #9 by Joseph_Oster

I wonder how to add the part about moving rectangles keeping them intersected.

Many thanks!

Best regards,

Julia

In your sketch, all cell clusters are composed of 3 or more â€śsquaresâ€ť?

Will the individual cells remain squares and aligned grid-like like in your sketch or wildly change in size and proportion, making some or all polygons or rectangles?
The moving part is not really an issue, since â€śgrowingâ€ť clusters might be more appropriate here, meaning that you start from a cell and append appropriate, matching neighbours.

Sure, but you should make up your mind about what you want to do and establish some rules.

Hi,

thank you for your reply. My apology for the late reply. In the meantime, I was trying some solutions.

Basically what I would like to achieve is something like this animation

Rectangles change size and proportion and they should be fully intersected.

In my script I can change input data (width, length of rectangles and points position). I set a condtion, when the two rectangles are not fully intersected, the solution is not created.

I will use this dynamic sizing for energy simulation and I would need to get always a solution (with fully intersected rectangles).

Do you have any idea what rule could be applied?

Many thanks!!!

What does â€śfully intersectedâ€ť mean? Do two sides of one rectangle need to intersect exactly two of the other one? Is overlapping allowed and seen as â€śfullâ€ť intersection?

How do you want to change the state of the configuration? Do you want to play around with a single slider or get a certain number of possible permutations?

See ya in three weeks.

1 Like

Hi:)

I would like to have two rectangles overlapped. Please see the schema below:

Iâ€™ve started with the creation of two rectangles. So far you can change their dimension, keeping the fixed area of each. Now I need to apply a rule to move them and change their position.

It doesnâ€™t matter if one or more sliders are used to get a certain number of permutations.

Best regards,

Julia
Shape L_1.gh (14.4 KB)

Hi,

I think I found a solution. I am not sure if itâ€™s the most efficient way to achieve what I wantâ€¦
Maybe you can suggest me a better idea:)

Many thanks!
Shape L.gh (29.9 KB)

Julia

Hi,

Hereâ€™s another way to do this a bit differently and potentially more economically.

Instead of two rectangles that have to completely intersect each other, thereâ€™s a central rectangle and 4 rectangles that get constructed on its edges.

Everything is fully randomized, but you can control the boundary conditions, like the minimum and maximum dimensions.

A single slider lets you flip through different permutations.

shaper.gh (18.3 KB)

Best wishes for 2023!

1 Like

You can try Monoceros or Wasp plugins.

1 Like

Thank you very much to show me other perspective to solve this problem:)
All the best for you as welll in 2023!!!

1 Like

Thank you very much! I will check them.

All the best!

Julia