Drawing circular arcs?

Hi everybody,

Is there a way in openFrameworks to draw a circular arc (green), defined by two end points (dark blue) and a directional vector (red)?

There seems to be nothing akin to ofDrawArc(...).

What am I missing?

I’ve searched “arc” in openframeworks.cc/documentation and it returned
https://openframeworks.cc/documentation/graphics/ofPath/#!show_arc
https://openframeworks.cc/documentation/graphics/ofPolyline/#!show_arc

not sure about the directional vector.

1 Like

also if helpful

my guess is you’d need to compute the circle, then figure out what the start and end angles for the arc to draw (there would always be two arcs, so I guess it would always be the sorter one ?!)

if helpful, dubins path may be helpful for this kind of problem

1 Like

Hey would ofDrawCurve() work? There must be a way to calculate the 2 control points needed for a (circular) arc.

1 Like

@dimitre & @zach Thanks for the links. I should have checked the documentation myself, instead of relying only on code completion. :wink:
There doesn’t seem to be a method for two end points and a direcitonal vector, but I think my custom Arc struct already has all necessary information to provide what’s required by the ofPath methods. The StackExchange thread has some useful information, too!

@TimChi I’d have to look into that, but it seems a little overkill for this case. Thanks for the suggestion though.

1 Like