Hello! I am a new Dynamo user, mostly experienced in the Rhino+Grasshopper environment rather than the Revit+Dynamo environment. I have a project for which panels of different types need to be stacked on a truck for delivery. The first figure below shows panels in Revit laid out on the plan (each row means a different type of panel) on the left, with each truck load boundary on the right.
I am using Refinery 1.1.1 (I can’t install the latest version 3.0.2 because of the Dynamo version issue in the company) and I have two specific issues.
The first one is, I want all the panels to be stacked in the same orientation as they lie on the plan. When panels (cuboids) are put into containers (cuboids), some containers have panels being laid in different orientations. I checked xyz directions and everything is correct, but in the 3d packing node, somehow either xyz shuffles or something else happens, and the result is as you see in the figure below. The wide face of panels should always be top and bottom and the major direction should always be the same (long side of panels aligns with the long side of containers). Is there a way to restrict the stacking direction for panels in containers so that everything is stacked consistently?
The second question is, is there a way to pack different type of panels in a specific order? For example, I want all the large panels (in the figure, panels on the first row) to be packed in containers first, and then small box-like panels (in the figure, panels on the second row from the right end) to fill the remaining part of the container once the large panels are done. If I put different types of panels at once and run packing, it ends up in chaos in the container, which I don’t want to happen. Somehow, I managed to work on it by creating a smaller container within the dedicated portion of the large container and packing small panels into the smaller container. But I don’t think this is the best approach. Could anyone give me any tips?
Here is the screenshot of the dynamo script. I couldn’t upload the whole script because of the size restriction….
The toolkit doesn’t have a way to restrict orientation - one of a few issues which usually lead me to use my own algorithm. Based on your geometry configurations it may be that you want to do a few linear packing passes instead to group panels into stacks, and then treat the stacks as a combined block.
Another thing to consider on these types of project is that the most efficient packing is rarely the ideal solution on site as often you want to ‘pull’ things in the order you need them.
Hi Jacob, thank you for your comments. Yes, as you mentioned, there is no function such as “exhaust all panels in the same group first to stack them in a container and then pack panels in the next group if there is still enough space in the same container”. I tried miscellany before, and it only allows me to move on to the next group with a “new container,” even if more than half of the previous container is empty (and I would like to say refinery ends up with more “neat” workspace given my limited capabilities). It looks like those two options (refinery and miscellany) are the only ones readily available for 3D packing.
For your own algorithm regarding the orientation restriction, could you provide some tips or guidelines on how to incorporate something into this? Or should it be something that I completely create from scratch (since I do not have a strong enough programming background to do that…just some additions are manageable though)?
And yes, we have discussed the stack order vs. the on-site pull order since one of the two goals was to reduce unloading time. We ended up leaving that issue as the current practice since automating stack planning is the primary goal of the first phase of the project.
You’ll need to do some custom coding.
Below is an outline for a basic process for generative packing which just aims to ‘put the next object in the first place it fits’ without trying to optimize compactness.
- Generate objects with geometry with a controlled and functional origin - likely the corner point with all geometry in the +X+Y quadrant.
- Find a method for pulling the Nth permutation of the lot of objects. This is more efficient for controlling the sort order then what you’ll get with list.shuffle or other recording methods. I previously provided one in the package Generative Design At Hogwarts.
- Build a container object consisting of available space and occupied space.
- Build a method to generate a coordinate system at each vertex in the available space. These can be rotated or on the primary axis of placement (you want the layer which is good as that will reduce the number of coordinate systems significantly).
- Build a method to attempt placing the first item in the permutated list of objects in each of the coordinate systems until you find a location where it fits.
- Remove the object’s geometry from the available space of the container, and copy it to the output list at the respective index for container and placement position.
- If no functional location could be found, move to the next container.
- If no container can be found, put the object in a list of unplaced locations.
- Continue this until all objects have been tested or you run out of containers (highly unlikely).
So there are a LOT of steps and a LOT of technical concepts you’ll need to code this. That said as the concepts are quite basic you can likely use an AI engine and some trial and error to get a functional result after you develop some basic Python skills (going through the Dynamo Primer and a Python primer should take a day or two if you focus). You could also use DesignScript but that will require a higher degree of expertise as the AI tools won’t have much training data to pull from. C# would be best but that is a larger upskilling effort.
Once you have the graph built you can start to look at evaluating the space. Metrics like ‘remaining air’ in the containers, even packing of the containers, pick order deviation, number of unplace objects, optimal placement for the center of gravity, even load distribution, etc can all be built fairly easy.
From there send it to generative design to let it explore the permutation space to find the ideal packing sequence.
The same concepts above can be expanded for space planning, equipment layout, room furnishing, and more.