How to fill an object in random tileable way with other objects

Community Beginner ,
May 04, 2021 May 04, 2021

Copy link to clipboard

Copied

Does anyone know by any chance if there are any script that can play it ,or any action plan for this?
here is an illustration what I mean, basically filling an object by creating grids from random objectScreenshot 2021-05-04 at 11.45.32.png

its done in after effect here is the source: workbench

TOPICS
Draw and design, Feature request, How to, Scripting, Third party plugins, Tools

Views

671

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
May 04, 2021 May 04, 2021

Copy link to clipboard

Copied

The options to fill are:

- plugin Phantasm: does a good job with the grid, can do custom objects in the grid, but only one of them.

- plugins ColliderScribe and Stipplism: do a good job with randomization, but the positions will also be random and not a grid.

 

So what you can do is first create the grid with Object > Create object mosaic

Then use a script or the plugin FindReplace to select random objects and replace them by symbols using the Replace script by kelsocartography.com

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 04, 2021 May 04, 2021

Copy link to clipboard

Copied

thanks but I dont have the plugin

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
May 04, 2021 May 04, 2021

Copy link to clipboard

Copied

There are scripts for random selection, such as: https://github.com/marcusguttenplan/adobe_scripts

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 05, 2021 May 05, 2021

Copy link to clipboard

Copied

tried with findandreplace but it can handle only one object fill

 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
May 05, 2021 May 05, 2021

Copy link to clipboard

Copied

What exactly did you do?

Can you show your artwork?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
May 06, 2021 May 06, 2021

Copy link to clipboard

Copied

Replacing tiles with random items is easy with scripting (if a bit pernickety); filling a path with tiles isn't. Doing the latter manually is easy though. This is a basic idea:

 

Step one, filling a path with tiles:

  1. Select the path and apply a fill to the path.
  2. Click Object > Rasterize.
  3. Click object > Create Object Mosaic.
  4. Ungroup the tiles.
  5. Select and delete the blank and unwanted tiles.

 

A.png

 

Step two, replacing tiles with random items:

  1. Import or create the paths to randomly replace the tiles.
  2. Bring the paths to randomly replace the tiles to the front (Ctrl + Shift + ]), i.e. they should be at the top of the layers panel.  This is a key step. 
  3. Select all.
  4. Run the script:

 

var n = prompt("", 8, "No. of items to randomly replace tiles:");
for (var i = app.selection.length - 1; i > n - 1; i--) {
    var pos = app.selection[i].position,
    w = app.selection[i].width,
    h = app.selection[i].height;
    app.selection[i].remove();
    var index = Math.floor(Math.random() * n);
    var duple = app.selection[index].duplicate(app.activeDocument, ElementPlacement.PLACEATEND);
    duple.position = pos;
    duple.width = w;
    duple.height = h;
}

 

B.png

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
May 06, 2021 May 06, 2021

Copy link to clipboard

Copied

LATEST

Thank you femkeblanco.

A simple elegant script, it works!

I have been searching for someting like this, but could not find it.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines