Arc without drawing radius lines

Hi,

I would like the arc to be drawn without seeing the radius lines :

path.moveTo(180,294);
path.lineTo(180,130);
path.lineTo(321,130);
path.moveTo(321,294);
path.arc(321,294,141,164,180,-90);
path.close();
path.setStrokeColor(ofColor::blue);
path.setFillColor(ofColor::red);
path.setFilled(false);
path.setStrokeWidth(2);

Thanks.

hello,

maybe you shouldn’t close the path

It removed only one radius line, not both… :sweat:

as i understand, lines and arc are two distinct lines of a same shape ?
Whenever you move a point it draws a line between them.
If you need separated lines, i think you may need to close the lines shape before moving to the arc starting point or create a new subPath.

Actually I think this is a bug.
I added it on github:

https://github.com/openframeworks/openFrameworks/issues/5236

The issue is the first two params is the center of the arc not the starting point of the arc and internally ofPath is adding a moveTo - but doing it to the center, so you see the line from the center to the start.

1 Like

A quick solution for now while we get this fixed is to use ofPolyline if you can.
ofPolyline has an identical arc function and works as expected.

All the best
Theo

2 Likes

Thanks.