Copy link to clipboard
Copied
Hello, everyone. I am familiar with scripts, but I don't have a deep understanding of js.
I need help with the following:
- I have an artboard with some objects (all groups);
- I need to fill the empty spaces on the artboard with other objects, for example, they could be rectangles measuring 5cm by 3.7598cm (but the future idea is to fill them with other files that have objects with the same dimensions);
- This filling needs to take into account the best distribution of the objects, so that they do not overlap and that they follow a spacing of 3mm; - These rectangles can be rotated 90 and 180 degrees (as the script considers the best arrangement).
- This 3mm spacing needs to be between the objects;
- There is no need for spacing between the rectangles and the artboard limits.
- The challenge is to calculate the area and calculate the possible arrangements to fill with the rectangles;
- The best arrangement is not crucial for me, the important thing is just to fill to avoid so many empty spaces.
I will leave some images to illustrate.
Copy link to clipboard
Copied
Hi @MarcosAdriano1994 I don't have a fully out-of-the-box solution for you, but as a start you could look at my bin packing script. It currently uses the document's artboards as the "bins", which won't work for you because you have space taken up already. A workaround could be to make artboards around your existing artwork and try the script. I tried it quickly—see screenshots below.
To use read instructions from the repo above, download the script files and run the script "Bin Packing--Artboards.js".
- Mark
Copy link to clipboard
Copied
Thank you, I will test and see if I can adapt something. Any result I get I return here to comment.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more