Generating random shapes within predefined boundaries

Hello everyone, first time posting.

I’ve been using Revit for a while and now I am hoping to learn more about generative design.
Naturally I began exploring Dynamo and I wanted to get some advice on how to proceed.

So here’s what I want to do.
I want to generate random building volumes within a set limit, very similar to the “Building Mass Generator” script shown in the sample workflow of the primer, but with more restrictions.

Let’s say there is a site as shown (attached image). Up is north.
The white represents the site and the dark blueish thing is the road.

Now, in my country there is a height restriction on all buildings depending on the road width, which way the boundary line of the adjacent land is facing, etc.

Looking from the west, the line on the right is restriction by road width, and the left represents restriction by boundary line. (attached image)

Looking from the south, both lines represents restriction by boundary line.(attached image)

These restriction lines vary in slope, height, etc by project, so I need to be able to adjust them accordingly.

And most importantly, the building cannot touch any of these restriction lines.
So basically I want to draw an invisible boundary line that the building cannot touch, based on the intersections of all the restriction lines I drew above. (attached image)

To summarize, I want to

  1. Set variables for restriction line (origin, slope, height, length, etc)
  2. Draw the restriction lines
  3. Define the space that the building cannot step out of (the white shape in attached image)
  4. Generate random building volumes within the above restriction lines.

Step 4 I can somehow make out from the sample workflow.
Step 1-3, I dont even know where to start, so if someone could point me in a direction, I would highly appreciate it.

Thank you in advance!

Hi @opb ,

I would suggest you start by Setting some restrictions. Does the site always have 4 corners(e.g. 4 directions (north, south, west and east)?

Then start by create a big extrusion base on you site and your building limit.
Next I don’t like the term Boundary Lines. Because this hints that these are lines, which by looking at your image are more like surfaces or planes. I would advise to create your Boundary Planes next based on their parameters:
Offset from the Base
Offset from the Boundary (Road Width)
The angle of the plane

And then Slice, Slice, Slice and Slice!!
Random Building Volume.dyn (241.0 KB)

Might be worth it to reverse your thinking.

Make an inverse mass, which is the volume outside of your restrictions, then generate the proposed building masses and boolean it with the inverse-restriction-mass. Any solution that generates a solid from that you can reject.

Hello @Joelmick

Thank you kindly for your input and dyn file!
The site can have more than 4 corners and the site will rarely be a perfect square like in the example I made.
I will now start examining the dyn file you created for me and try to understand how it works.

Thank you again.

Hello @Bjorn_Keulemans1

Thank you for your input, I like that idea!
I will give it a try…
Thank you again.

@Joelmick @Bjorn_Keulemans1

Thank you for your input regarding the topic above.
I tried to figure it out on my own after that, but gave up in about 2 months…
But I decided to give it another go!
And I did some more thinking as to what kind of functions i need, what I want to accomplish, etc.
I’ve posted a new topic here with new visual explanations.
If you have the time, please let me know what you think…

Thank you again