Skip to main content
Known Participant
May 4, 2024
Question

Drawing Perfect Circle With Equally Spaced Cutaways

  • May 4, 2024
  • 3 replies
  • 4376 views

Hello all!

 

I request your help with the following:

 

I would like to draw a perfect circle, with a specific number of equally spaced cutaways, each of equal size. I also need to be able to specify the amount of the line that is removed by each cutaway.

 

Essentially, I want to make a circle with a dotted line, as in the attached image. However, I need to be able to specify each of the parameters mentioned above.

 

Thank you!

This topic has been closed for replies.

3 replies

pixxxelschubser
Community Expert
Community Expert
June 13, 2024

Hi @Thomas22842972ml5u 

has your problem been solved?

pixxxelschubser
Community Expert
Community Expert
May 5, 2024
quote

Hello all!

 

I request your help with the following:

 

I would like to draw a perfect circle, with a specific number of equally spaced cutaways, each of equal size. I also need to be able to specify the amount of the line that is removed by each cutaway.

 

Essentially, I want to make a circle with a dotted line, as in the attached image. However, I need to be able to specify each of the parameters mentioned above.

 

Thank you!


By @Thomas22842972ml5u

 

First of all: What you want is not possible according to logic!

 

If the circle exists, then you cannot define the number of lines (and the necessary gaps) as well as the length of the lines and the length of the gaps - and at the same time maintain the diameter of the circle.

 

Assuming that the diameter of the circle is given and should be retained, you can, for example, change the number of lines (and the required gaps) and the length of the lines. The length of the gaps is then a value that results from the calculation.

To get started, here is a simple script that assigns a dashed outline to a selected circle (existing in the Illustrator document). The required number of lines is queried in the dialogue box (I have not included error management).

 

 

 

var aDoc = app.activeDocument;
var aSel = aDoc.selection[0];
var aSelLen = aSel.length;
var amount = prompt ("how many dashes?", 20, "how many dashes?");
var amountDashes = Number (amount);
var lineLen, gapLen = null;
lineLen = Math.round(aSelLen/(amountDashes*2)*10000)/10000;
aSel.strokeDashes = [lineLen];

 

 

Known Participant
May 6, 2024

I understand that the diameter of the circle will limit the result. The parameters I've mentioned can nevertheless still be specified within these limits.

 

Thank you for the script. I've never used a script in Illustrator; how do I go about this?

 

pixxxelschubser
Community Expert
Community Expert
May 6, 2024
quote

… Thank you for the script. I've never used a script in Illustrator; how do I go about this?


By @Thomas22842972ml5u

 

  1. Copy the code and paste it into a text editor (please do not use Word or similar).
  2. Save as your-new-script.txt (as *.txt -> Plain text !!!).
  3. Now change the extension from ‘.txt’ to ‘.jsx’ in Windows Explorer or in the Mac Finder.
  4. Move this file to the script directory corresponding to your Illustrator version.
        On my German Windows system, I use the following folder for my scripts:
        C:\Program Files\Adobe\Adobe Illustrator 2024\Presets\de_DE\Skripten
        C:\Program Files\Adobe\Adobe Illustrator [your version]\Presets\[your language folder]\Scripts

  5. Restart Illustrator!

 

----------------------------------------------------------------

From Illustrator Scripting Guide:
Installing scripts in the Scripts menu

To include a script in the Scripts menu (File > Scripts), save the script in the Scripts folder, located in the /lllustrator CC/Presets folder in your lllustrator CC installation directory.

The script’s filename, minus the file extension, appears in the Scripts menu.

Scripts that you add to the Scripts folder while Illustrator is running do not appear in the Scripts menu until the next time you launch Illustrator.

Any number of scripts can be installed in the Scripts menu. If you have many scripts, use subfolders in the Scripts folder to help organize the scripts in the Scripts menu.

Each subfolder is displayed as a separate submenu containing the scripts in that subfolder.

 

Monika Gause
Community Expert
Community Expert
May 4, 2024

Are you referring to dashes? CHeck out the stroke panel.

Known Participant
May 5, 2024

But the stroke panel doesn't allow me to specify the parameters I've mentioned.

Monika Gause
Community Expert
Community Expert
May 5, 2024

Specifying gaps and dashes does not work?