Skip to main content
Inspiring
July 5, 2023
Question

Can you create circle with CreatePath expression?

  • July 5, 2023
  • 1 reply
  • 880 views

Can you create a circle with CreatePath()?

If not, is there another way to create a circle using expression?

 

This topic has been closed for replies.

1 reply

Dan Ebberts
Community Expert
Community Expert
July 5, 2023

Something like this should work:

r = 100; // radius
ratio = .5523;
t = r*ratio;
vertices = [[r,0],[0,r],[r,2*r],[2*r,r]];
inTangents = [[t,0],[0,-t],[-t,0],[0,t]];
outTangents = [[-t,0],[0,t],[t,0],[0,-t]];
closed = true;
createPath(vertices,inTangents,outTangents,closed);
Dan Ebberts
Community Expert
Community Expert
July 5, 2023

This version might be better--it's centered at the anchor point:

r = 100; // radius
ratio = .5523;
t = r*ratio;
vertices = [[0,-r],[r,0],[0,r],[-r,0]];
inTangents = [[-t,0],[0,-t],[t,0],[0,t]];
outTangents = [[t,0],[0,t],[-t,0],[0,-t]];
closed = true;
createPath(vertices,inTangents,outTangents,closed);