I'm afraid that I don't have the time to work on an example at the moment but it really shouldn't be difficult to do it yourself. Given the four corner positions of a rectangle and a radius it is simple arithmetic to work out the start and stop positions of the four arcs, draw them and then draw lines between them using the same positions.