Skip to main content
theBFG
Participant
March 8, 2011
Answered

Creating Arcs by Center, Radius, and Arc angle

  • March 8, 2011
  • 1 reply
  • 2494 views

Is there a way to create (script)  an arc by center, radius and arc angle?  or by 3 points?

By arc i mean a regular arc, as in a piece of a circle.  It seems the native illustrator tools make it very difficult to create a regular arc in the normal CAD way of drawing one.  I found a forum post from a guy years ago that said he had created script to make arcs this way.  Have you come across this anywhere? Any ideas?

Thanks,

This topic has been closed for replies.
Correct answer Ten A

There is a sample, create an arc.

var lnColor = new GrayColor;

lnColor.gray = 100;

var r =100; //radius

var ln = app.activeDocument.pathItems.add ();

ln.stroke = true;

ln.strokeColor = lnColor;

ln.strokeWidth = 0.3;

ln.filled =false;

var pt = ln.pathPoints.add()

pt.anchor = Array(0, 100);

pt.rightDirection = Array((Math.sqrt (2)-1)/3*4*r, 100);

pt = ln.pathPoints.add();

pt.anchor = Array(100, 0);

pt.leftDirection = Array(100, (Math.sqrt (2)-1)/3*4*r);

Read below article.

Way to tell perfect circle from an ellipse?

and I think, you'd better read this page.

http://en.wikipedia.org/wiki/B%C3%A9zier_curve

1 reply

Ten A
Community Expert
Ten ACommunity ExpertCorrect answer
Community Expert
March 9, 2011

There is a sample, create an arc.

var lnColor = new GrayColor;

lnColor.gray = 100;

var r =100; //radius

var ln = app.activeDocument.pathItems.add ();

ln.stroke = true;

ln.strokeColor = lnColor;

ln.strokeWidth = 0.3;

ln.filled =false;

var pt = ln.pathPoints.add()

pt.anchor = Array(0, 100);

pt.rightDirection = Array((Math.sqrt (2)-1)/3*4*r, 100);

pt = ln.pathPoints.add();

pt.anchor = Array(100, 0);

pt.leftDirection = Array(100, (Math.sqrt (2)-1)/3*4*r);

Read below article.

Way to tell perfect circle from an ellipse?

and I think, you'd better read this page.

http://en.wikipedia.org/wiki/B%C3%A9zier_curve