I am a student and novice to Dynamo. I did a lot of work for days on my design, but when I did a generative design, it was wrong. Let me explain: I have a confined construction site (y=25m by x=20m), a site inside the city, and the roof of the building under construction is the site, and I need an optimized site layout. I have three containers (12m by 2.35m) as cabins for workers and staff. One storage cabin and one washroom area, and a big open storage area. The site has 60cm by 60cm columns at the corners of a 5m by 5m area means we have 30 such columns, a fixed crane and hoist at (y=0, X=20). For generative design, I have six constraints: 1. All the cabins must be inside the site boundary, 2. The cabins must not intersect the columns, 3. Clear operating area for crane, 4. Hoists and cabins must not intersect 5. There is a safety buffer boundary of 1.5m (nothing is allowed in this area) around the site (except on one side where x=20m), 6. Cabins must not intersect each other. There is a preference for minimum distance traveled, based on which generative design will be done, which is called WATD, and it is based on an edge of the site (X=20, Y=12.5). Now, when I run the generative design, it shows conflicting results; first, almost all the constraints are neglected, like the cabins are outside the site, the cabins intersect each other and the columns as well. The main reason is that the system only considers centerpoints for constraints, and the design does not consider the shape of cabins, but it considers the x and y axes of these cabins. Can you please analyze the file and instruct accordingly. I am a new member and can not upload the file, I can only upload one photo. I will share one screenshot. I will be grateful if somebody contacts me by message here.
Constraints are generally not a functional use.
Instead I recommend including a means of evaluating everything you care about and letting the algorithm explore the space.
This is because constraints are flawed - any time a result doesn’t fit on the site you get no result and instead a new sample is run. After N extra samples the results are just pushed though (otherwise the generation would never finish).
By evaluating how well things fit on the site (say by taking the area which is outside the site limits) you can evolve the design until everything is within the site limits. There are a few considerations with that - primarily around reducing the number of boolean operations you run - combining things to poly surfaces is a good way to do that.
It’s different specifics, but I built a graph for a similar use case live in a user group meeting a few years back. The recording can be watched here: https://m.youtube.com/watch?v=42SylTdN3CY
Constraints are what you program them to be. Generative design isn’t magic, it’s just a brute force engine for an algorithm that the coder must write.
There are two ways to enforce pass/fail constraints:
-
The logic of how you place the spaces on the site must be set up so that it cannot be outside the boundary. For a square shaped site you can do this by beginning the placement from a random corner, insetting by a random distance in X/Y, then making a random sized box on one side with the consequential size driven by its area
-
Let the boxes be outside the site, but use intersections to check if they are in an outcome. If they are, set the fitness to 0 versus the measured outcome, or use a ‘valid’ outcome that is 0 or 1. Filter those out in your result assessment
The good thing about 2 is you have to do less work, but 1 is better as you will know that every option is going to be somewhat valid and the study will be less wasteful.
Obviously the more constraints you get, the harder it will be to ascertain the best approach. E.g. you might let the boxes be flexible within the site and filter out all options where a column is hit or a box hits another one, but this will likely be the vast majority of outcomes.
Thank you for your responses, Jacob and Gavin. Your instructions were helpful. Kindly find my file attached here and guide me accordingly.
My Design.dyn (290.2 KB)
I took a look at this, and while I don’t have and have some feedback. Don’t let any of this discourage you, as you’ve done some good work to get to this point! Instead consider this as a way to progress your growth from someone who’s turned Dynamo use into a career.
- Don’t rename nodes other than inputs and outputs. It doesn’t help you identify what is happening, only what you have at that point, and a named group (i.e. produces the cabin shapes) does far more benefit as it allows not just a new name, but a description as well.
- Group ALL nodes. Seriously - everything. Someday you’ll have to open this again after a week, a month, a year, and you won’t be able to make heads or tails of it in the current shape.
- Make sure all nodes move from left to right. Nodes which move top to bottom or right to left are a way of cursing your future self.
- Group all input nodes in a readily identifiable color, all output nodes another color, all display nodes a third color, and all other nodes a fourth color.
- Make sure all geometry preview other than what you need is disabled.
- Review the primer section on list lacing and levels. There are a few areas where inputs could be gathered in a list and objects created from the list, resulting in more direct results in less time and will less RAM (faster and more stable in GD).
- Consider using selection nodes, or JSONs instead of building everything form scratch.
- Rectangles by dimensions (or other shapes at the origin) and transforming them by a coordinate system on the surface representing the maximum site constraints is likely a better path forward than manually creating point sequences for each rectangle.
Now that this is out of the way… you’re really close. I would discard your current evaluation and use the PolySurface.ByJoinedSurfaces node to create collections of things to test each cabin or collection of cabins against. From there, completely ignore the constraints - they’re going to cost you more time as I noted above.
With those edits made, I get results which fit inside your limits, don’t overlap, and avoid all columns in ~40 generations with a sample size of 100 when I do so:
In 100 generations I get 78 results with a perfect score - this likely means you need a few more evaluation criteria. My graph additions look like this:
Good luck!
Thank you for your kind guidance. I really appreciate it. It was my first project, so there were some flaws and problems, but I will work to fix all the problems. Again, thank you.


