InkyPHAT - How to use arc?


#1

I understand there’s the builtin function for arcs inkyphat.arc but I don’t understand how to use it correctly. Can someone help explain that with some examples?

Playing around with the given inkyphat.arc((0, 0, 212, 104), 0, 180, 2) gives a red arc that start at the middle of the screen and drops to the bottom of the screen before coming back to the middle of the screen.

Flipping the 0 and 180 above changes the arc to go to the top of the screen instead of the bottom.

The 0, 0 starting point doesn’t really seem to matter as much as the 212, 104 ending point for controlling the height of the arc from base. This is where I’m getting confused. Would like to make one arc that starts at the bottom left of the screen, reaches the top, and ends in the bottom right. Then a second arc that starts at the same place, but doesn’t go as high as the top like the first arc, and then ends at the same place on the bottom right. How can I do this?


#2

The documentation for PIL states:

PIL.ImageDraw.Draw.arc(xy, start, end, fill=None)
Draws an arc (a portion of a circle outline) between the start and end angles, inside the given bounding box.

Parameters:	
xy – Four points to define the bounding box. Sequence of [(x0, y0), (x1, y1)] or [x0, y0, x1, y1].
start – Starting angle, in degrees. Angles are measured from 3 o’clock, increasing clockwise.
end – Ending angle, in degrees.
fill – Color to use for the arc.

The starting/ending angle represent points on the edge of the bounding rectangle where the arc starts and ends. A starting angle of 180 and an ending angle of 0 would draw an arc from the left to the right of the bounding box.

I think it works in the same way as PyGame: https://youtu.be/Ok3vbJ0cwtk?t=127