Copy link to clipboard
Copied
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,
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.
...Copy link to clipboard
Copied
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.