Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could your nodes be used for 2d packing? #11

Open
thomascorrie opened this issue Nov 7, 2018 · 6 comments
Open

Could your nodes be used for 2d packing? #11

thomascorrie opened this issue Nov 7, 2018 · 6 comments
Assignees
Labels
enhancement New feature or request question Further information is requested

Comments

@thomascorrie
Copy link
Owner

thomascorrie commented Nov 7, 2018

Could your nodes be used for 2d packing? If the z values were just 0? Wondering if I could then pack rectangles and get there centre points for locations to pack views on sheets. I would be inputting bounding boxes. Not sure what your exact container input formula is that the nodes take. Sorry for the comment in the wrong place. Still understanding git hub and couldn't figure out how else to ask.

I'm not at work to try it with 2d. What node is going into the algorithm inputs? Do you have a YouTube video or some example graphs set up?

Originally posted by @Vanman989 in #1 (comment)

@thomascorrie thomascorrie changed the title Could your nodes be used for 2d packing? If the z values were just 0? Wondering if I could then pack rectangles and get there centre points for locations to pack views on sheets. I would be inputting bounding boxes. Not sure what your exact container input formula is that the nodes take. Sorry for the comment in the wrong place. Still understanding git hub and couldn't figure out how else to ask. Could your nodes be used for 2d packing? Nov 7, 2018
@thomascorrie thomascorrie added the question Further information is requested label Nov 7, 2018
@thomascorrie thomascorrie self-assigned this Nov 7, 2018
@thomascorrie
Copy link
Owner Author

thomascorrie commented Nov 7, 2018

@Vanman989 yes, the node can be used for 2D packing although I don't know off-hand how optimised it is for 2D because EB-AFIT was originally written for 3D. Feeding 0 for Z for items or containers into the algorithm will fail (something I need to fix in future releases) so I used a value of 1 for items and containers and then ignore Z from the outputs and build rectangles instead of cuboids. I have attached a sample graph to this comment which is adapted from the sample included in the package for ContainerPacking: Miscellany-Samples-PackContainer2D.zip (I had to zip it to add to the comment as GitHub doesn't support adding dyn files to comments). I hope this is of help

pack2d
2dpackinggeometry

@thomascorrie
Copy link
Owner Author

One additional thing to note is that EB-AFIT will test all possible orientations, so in its current form it isn't possible to restrict the X and Y dimensions to their original axes, which I assume you would want given that you want to use it to place views on sheets (and I assume you don't want them arbitrarily rotated 90 degrees just to fit in)

@Vanman989
Copy link

Thanks Thomas, this is great. Yes, unfortunately I would not want the rectangles rotated and positioned top left of the page to start and then along the page, then placed underneath and so on. Thank you for the sample. Missed your original sample you uploaded getting a good understanding of github. I will definitely be testing with your nodes to see what sort of results I can get.

The only solution I can think of to achieve the rectangle stacking I want at the moment is to place the rectangle (view) in the center of a rectangle (sheet) and create some sort of python loop to move the rectangle towards the top left until it clashes with the sheet bounding box. Then proceed with the next. I have very minimal knowledge of python at the moment but hoping I can implement it with some more research into what other nodes are out there.

@thomascorrie thomascorrie reopened this Nov 8, 2018
@thomascorrie thomascorrie added the enhancement New feature or request label Nov 8, 2018
@thomascorrie
Copy link
Owner Author

As well as in this repository, the samples are included in Miscellany when you install from the Dynamo package manager, within the folder \packages\Miscellany\extra\

An implementation in Python could follow similar lines to this Ruby version. Most implementations seem to follow a tree route.

As for 2D implementation in MIscellany, I can look to add one where it would be possible to choose the starting point and also whether objects are allowed to be rotated. I'm reopening this issue as an enhancement with the aim of adding it soon.

@Vanman989
Copy link

Vanman989 commented Nov 8, 2018

Anything you do would be appreciated. Thank you for the great info. Points me in the right direction. I know many people on the dynamo forum struggle with the issue of stacking views like windows, shop drawings, precast and steel onto sheets from a list. I'll be sure to share any of your Miscellany enhancements towards 2D on the dynamo forum.

Your output of unpacked things is great. Can use that to create the next sheet for stacking

@Vanman989
Copy link

Hi John, if its of any interest to you. This guy has so many great methods to 2D Bin packing :)

https://github.com/juj/RectangleBinPack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants