Skip to main content
Jongware
Community Expert
Community Expert
October 1, 2010
Answered

[Ann] Design effect - image made of perfectly arranged circles

  • October 1, 2010
  • 35 replies
  • 155252 views

Ever wondered how to perfectly fill an outline with touching circles? I did -- after seeing the example image in Solving design effect - image made of perfectly arranged circles.

 

It took me a while to get the proper calculations, but -- Here It Is! A Javascript, written for Illustrator CS4 (it might work on other versions as well), that fills a selected outline with circles. Download zipped script from my site: #1 http://www.jongware.com/binaries/CircleFill.zip #2 (https://shared-assets.adobe.com/link/7cf1dee2-08bc-435f-6fbc-546d36937712) unpack if necessary, and put it in your Illustrator Scripts folder to make it available the next time you run Illy, or anywhere else (you have to browse for it each time).

 

Select any path -- but no live text, please; you have to convert it to outlines and select each character in turn. Then run the script.

It displays a simple dialog, where you can set a maximum and minimum circle size as a percentage of the selected object size. In addition, you can select either a plain basic color, or select any of your current Swatch Groups; in that case, each of the circles are filled with a random color from that group.

 

The script may take a while to run. Usually, only a couple of seconds for a simple rectangle, but it may run into minutes for objects with lots of curves and/or holes. I didn't have the guts to run it on a vectorized world map, to recreate Mario "Quasimondo" Klingemann's Foam World Map; but, in theory? Possible.

 

This image only took a few minutes:

 

 

Enjoy, everyone!

 

{Script Download Link option Updated by MOD}

Correct answer Anshul_Saini

Hi @Merchant Girl and @Long98A1,

 

Thank you for reaching out. I have added a second option to download the script created by OP @Jongware.

I hope it helps.

 

Thanks & regards,

Anshul Saini

35 replies

Inspiring
November 15, 2010

Jongware,

Thanks for circles and beetlebum -- great together. (Got to get back to real work now!)

tromboniator
Community Expert
Community Expert
November 15, 2010

I get this in CS3 when I run this script:

Suggestions?

Thanks,
Peter

Jongware
Community Expert
JongwareCommunity ExpertAuthor
Community Expert
November 15, 2010

A quick peek in the ESTK under Illustrator seems to indicate CS3 can't script swatch groups ...

The idea of using a swatch group was to get random colored circles -- if you don't need that anyway, I can take out the entire swatch group selection to make a CS3-compatible version.

tromboniator
Community Expert
Community Expert
November 15, 2010

That would be excellent, thanks.

Peter

Jongware
Community Expert
JongwareCommunity ExpertAuthor
Community Expert
October 2, 2010

Update: www.jongware.com/binaries/CircleFill-1.1.zip

1. The Relative Size determination wasn't really very good. Fixed. (Hopefully)

2. Holes in polygons threw everything off and were handled quite badly. Now proper (non-self intersecting!) polygons with holes in them are properly triangulated -- code ought to be a bit faster ... A propos: every single path inside an outer one is considered a 'hole', regardless of what Illustrator says. Don't try with two overlapping paths either; only use a simple outer path, with simple holes -- something like a '0' or '8' shape is good.

3. Added a useful parameter: minimal distance between two circles. This is only between circles, they still may touch edges.

Here is a sample: a big 'A' over a big 'B'. Separated, then filled 'A' only parts with greens, 'B' only parts with reds, and parts that are in both with browns. Then cut out the entire combined path out of the background rectangle and filled that with yellows.

(I meant to create a Protanopia-type Color Blindness test, but I guess I should have checked what they actually looked like before trying Still, it's an interesting image.)

.. as is this

Jongware
Community Expert
JongwareCommunity ExpertAuthor
Community Expert
October 2, 2010

Kurt Gold
Community Expert
Community Expert
October 2, 2010

Where is France, where is the United Kingdom and – of capital importance – where is Texel on that map?

;-)

Inspiring
October 2, 2010

Thanks for so generously sharing your talent!

_scott__
Legend
October 1, 2010

Thank you!

Works great in CS5 here.

Don't do orginary
Participating Frequently
April 13, 2021

How can I download this script?