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
  • 155255 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

JoME
Participant
November 16, 2016

Hi
iam using it on Illstrator CS6 and getting an error message:

the attributes injected in the script were:
max 2%min 0.5 %

min dist. 0pt

it already worked once with values < 1 ... so that should not be the problem, dont know which layer should be meant o.O

EDIT: so i just put the layer in top of all others now it seems to work .. so not that important if you keep it in mind when using it (y) - thank for that awesome script

Cactus Cowboy
Inspiring
November 1, 2016

Jongware; nice script. works in CS6. Only short coming to me is it locks-up Illustrator when I try and enter a negative integer like ie: min% 0.1. As long as they're whole numbers no problem. Unusual you just giving it away when I'm sure you could have made some money on it. In what seems like a time when you can't even find free clipart hardly it's refreshing to see the old school spirit of the web still alive. Nice job.

lisapru
Participant
October 30, 2016

Hi Jongware,

i could fill the letters correctly with the script but it didn't work with the background.

I put a rectangle in the background and made a subtract of the letters - image left shows the area i want to fill with the script and then i got the error message.

The right picture shows the filled letters - just missing the background.

So, i should check all the layers for a single point or do you have another idea?

Thanks! Lisa

Jongware
Community Expert
JongwareCommunity ExpertAuthor
Community Expert
October 31, 2016

I am very short on time these days but I did a quick test with your cut out text. And .. nothing happened! No error message (so you still might have a stray point somewhere – please note there is a Select Stray Points menu item!) but also no circles.

It could be such a shape is too complicated for my script, although I did not expect it to do nothing in such a case.

This needs in-depth looking at and debugging I'm afraid – and, alas, I am pressed for time so I cannot do so immediately (or in the following few days) ...

stevem89033964
Participant
April 5, 2016

I just tried running this Illustrator CS2. I get an error message that says the following: Error 22: Window does not have a constructor. Line 32. It says some more stuff but I don't know how to insert an image. It won't accept the screen shot. I saved it as a jpeg but it won't accept my image.

Jongware
Community Expert
JongwareCommunity ExpertAuthor
Community Expert
April 6, 2016

Illustrator CS2 is currently 11 years old. The script was "written for Illustrator CS4 (it might work on other versions as well)" but when saying that I assumed people would try to use with on newer versions, not on antique ones. At the time my CS4 was considered already pretty old.

Known Participant
November 23, 2015

that was really awesome, sorry for the late reply, thanks for sharing.

Participant
July 27, 2015

Just wanted to drop a quick note:

THANK YOU FOR THIS AWESOME SCRIPT.

That is all.

Sincerely,

Ben

Inspiring
April 8, 2014

that's awesome. thank you very much.

i'm gonna have to come up with a reason to use it at work.

TREX8905603
Participating Frequently
January 8, 2014

Thank you Jongware....Brilliant!

I have used Illustrator for many years and this is the first time I have ever installed a script into Illustrator as I tend to rely on the standard scripts and styles etc already built in. I will be certainly be using this script for future projects.

TREX

Jongware
Community Expert
JongwareCommunity ExpertAuthor
Community Expert
January 8, 2014

TREX, thanks for having my script as "your first"!

And I hope this encourages you to try some of the other free Illy scripts floating around. There are the artistic ones such as mine, but also lots of tiny/little/big/HUGE time savers that are well worth checking out.

TREX8905603
Participating Frequently
January 8, 2014

Obey/Jongware, it's thanks to you.

This forum does not surprise me that there are a lot of genious's here giving fantatstic advice and knowledge!

TREX

Participating Frequently
October 21, 2011

Hi all, just saw this in my search for something very similar but without the varying sizes, in other words, filling a shape with circles of all the same, definable size. I looked at the javascript, but that is beyond my skills to manipulate. Would you have any advice or suggestions?

Thanks so much!!

Jongware
Community Expert
JongwareCommunity ExpertAuthor
Community Expert
October 21, 2011

That makes it a bit more complicated, unfortunately.

At present, the script selects a random point somewhere inside the shape. It then selects a random circle size from the list "radiiList" and checks if the point can hold a circle at that radius. If not, it simply adjusts the circle size to make it fit.

Your requirement is different, and close to "optimal packing" (which is a known problem in mathematics). I don't think it's feasible to adjust this script to make it optimally fill a path with same-sized circles, it would require a different approach.

Known Participant
January 8, 2014

Hi,

The script is very usefull, is it possible if we wnat to fill an object with randomletters like " D F R Y I O N U W S P  D R H" and so on....

Thanks

Participant
June 30, 2011

Im trying to use this in CS5 but when I change the text to outlines then i try and run the script I get this notice and then it never works

Jongware
Community Expert
JongwareCommunity ExpertAuthor
Community Expert
June 30, 2011

Well, I can't test with '5, so it can be just about everything.

Can you test if it works with a simple shape -- a circle or a rectangle? If it does, there is something different about the convert-text-to-outline system in CS5.

Monika Gause
Community Expert
Community Expert
June 30, 2011

The text is just grouped (even if it's a single letter) that's all. Ungroup it and everything works fine.