I assume that you only need this for right-angled triangles with sides parallel to the main axes, which makes things a little easier.
As you said, the right angle is easy.
For other angles, you need to calculate the centers of the circles. Say w and h are the width and height of the triangle. Let it also be said that x, y are the coordinates of the rightmost node. Center of the rightmost triangle: x - r * h / w, y - r . The angle that is covered by the arc to be drawn is Ο - Ξ± , where Ξ± is the angle you calculated using atan .
The top corner will be processed in the same way.
This should help you get started.
source share