Skip to main content
Participating Frequently
July 9, 2022
Answered

Circle of circles in a circle......

  • July 9, 2022
  • 3 replies
  • 1134 views

Hi,

I need to create the diagram below. I'm using Illustrator 26.3.1 (64 bit). I need a circle of 6 circles inside a circle of 12 circles inside a circle of 18 circle insode a circle of 24 circles inside a circle of 30 circles. I've created this using Rotate option but it's not exact. My circles need to be 2.54cm and the spacing needs to be exact and consistent. Can anyone help me with a formula for calculating the sizes of the inner circles and the angle to rotate each inner circle please?

Thank you.

 

This topic has been closed for replies.
Correct answer femkeblanco

This is based on a gap of one fifth of the diameter of the circles.  You can try changing the values of the variables in the first five lines of the script. 

 

 

var doc = app.activeDocument;
var n = 5;  // number of "parent" circles
var f = 28.346;  // cm to points
var d = 2.54 * f;  // diameter
var g = d / 5;  // gap
var r = d + g;
var m = 0;
var x = doc.width / 2;
var y = - doc.height / 2;
var circle = doc.pathItems.ellipse(y + d / 2, x - d / 2, d, d);
for (var i = 0; i < n; i++) {
    m += 6;
    var polygon = doc.pathItems.polygon(x, y, r, m);
    if (i % 2) {
        polygon.rotate((360 / m) / 2);
    }
    for (var j = 0; j < polygon.pathPoints.length; j++) {
        var top = polygon.pathPoints[j].anchor[1] + d / 2;
        var left = polygon.pathPoints[j].anchor[0] - d / 2;
        var circle = doc.pathItems.ellipse(top, left, d, d);
    }
    polygon.remove();
    r += d + g;
}

 

3 replies

Kurt Gold
Community Expert
Community Expert
July 10, 2022

That's a very good approach, Femke.

 

Another way (just for fun): A bumpy action that may be at least a bit entertaining.

 

Circle Array 1

 

Instructions:

 

- Download and unzip the file.
- Open the Illustrator file circle_array_001.ai
- In the Actions palette, import the action set circle_array_1.aia
- Run the action.

 

 

femkeblanco
femkeblancoCorrect answer
Legend
July 9, 2022

This is based on a gap of one fifth of the diameter of the circles.  You can try changing the values of the variables in the first five lines of the script. 

 

 

var doc = app.activeDocument;
var n = 5;  // number of "parent" circles
var f = 28.346;  // cm to points
var d = 2.54 * f;  // diameter
var g = d / 5;  // gap
var r = d + g;
var m = 0;
var x = doc.width / 2;
var y = - doc.height / 2;
var circle = doc.pathItems.ellipse(y + d / 2, x - d / 2, d, d);
for (var i = 0; i < n; i++) {
    m += 6;
    var polygon = doc.pathItems.polygon(x, y, r, m);
    if (i % 2) {
        polygon.rotate((360 / m) / 2);
    }
    for (var j = 0; j < polygon.pathPoints.length; j++) {
        var top = polygon.pathPoints[j].anchor[1] + d / 2;
        var left = polygon.pathPoints[j].anchor[0] - d / 2;
        var circle = doc.pathItems.ellipse(top, left, d, d);
    }
    polygon.remove();
    r += d + g;
}

 

Participating Frequently
July 10, 2022

Hi femkeblanco! This is awesome.....exactly what I need thank you so much for your help. Take care and enjoy the rest of the weekend.

Jacob Bugge
Community Expert
Community Expert
July 9, 2022

Douglas,

This key statement is a bit woolly: My circles need to be 2.54cm and the spacing needs to be exact and consistent.

 

Also, the everything depends on the overall appearance, unless you wish all five circles of small circles to have a circle at the very top or something similar.

 

Can you elaborate?

 

Participating Frequently
July 10, 2022

Thank you for taking the time to reply Jacob. Take care.

Jacob Bugge
Community Expert
Community Expert
July 10, 2022

The very same to you, Douglas.

 

Now you can enjoy this as a true holiday, given the solution by Femke..