Skip to main content
Inspiring
February 27, 2025
Answered

How exactly does AddArc work?

  • February 27, 2025
  • 1 reply
  • 218 views

Hello,

I want to draw 2 circles in the UI, and the following code used to work fine in the past (older AE version) but not anymore:

 

DRAWBOT_PointF32 center1 = { drawRectF.left + point.x , drawRectF.top + drawRectF.height - point.y };
suites.PathSuiteCurrent()->AddArc(plotPath, &center1, 4.0f, 0.0f, 360.0f);
			
DRAWBOT_PointF32 center2 = { drawRectF.left + point.x + 100 , drawRectF.top + drawRectF.height - point.y };
suites.PathSuiteCurrent()->AddArc(plotPath, &center2, 4.0f, 0.0f, 360.0f);

 

center1 and center2 basically have a difference of 100px in X and that's it. With this code I was able to draw 2 circles 100px appart from each other.

 

Now with the latest AE version (don't know in which version this changed), the result it kind of unexpected

I tried to use the MoveTo call between circles to prevent that middle arc, and it kind of worked but I only get half a circle for the second one, even though I specified the angles correctly.

 

One other odd thing I noticed, is that even if I use the MoveTo call, I still have to use the absolute position as "center" argument for the AddArc, this doesn't make much sense to me.

 

I don't know if I'm not getting how the AddArc function works now, or if this is actually a bug. Apparently no one uses this function since I don't see it in any examples nor referenced in this forum anywhere.

 

Thanks!

Correct answer shachar carmi

what i think is missing is a close() call for the path after each circle. if you look at the whole thing is one continuous path, then the wired shape you're getting actually makes sense. (given the path intesect itself going back from the end point of cicrle 2 back to the begining of circle 1)

i'm not 100% sure you can have multiple closed shapes in one path, but i think you can. at worse, draw the two shapes in two different paths and two different drawing calls.

1 reply

shachar carmiCommunity ExpertCorrect answer
Community Expert
February 27, 2025

what i think is missing is a close() call for the path after each circle. if you look at the whole thing is one continuous path, then the wired shape you're getting actually makes sense. (given the path intesect itself going back from the end point of cicrle 2 back to the begining of circle 1)

i'm not 100% sure you can have multiple closed shapes in one path, but i think you can. at worse, draw the two shapes in two different paths and two different drawing calls.

octaviosaAuthor
Inspiring
February 27, 2025

You are completelly right. If I close the path after each AddArc, ir works as I expect it to. I'm still not fully convinced this makes sense, but what's important is that it works. Thank you very much.