Script to add a rectangle with chamfered corners

Script to add a rectangle with chamfered corners

For Blender 2.54 and later

http://korostyshev.net/blender/rectangle.jpg

http://cwolf3d.korostyshev.net/images/rectangle/add_curve_rectangle.zip

Would it be hard to code it with rounded corners?

A few days working on the implementation of the rounded corner of the script does not work.
Rounded corners create one very simply:
1.
http://korostyshev.net/blender/rectangle1.jpg
2.
http://korostyshev.net/blender/rectangle2.jpg

All corners
http://korostyshev.net/blender/rectangle3.jpg

Latest version: http://cwolf3d.korostyshev.net/images/rectangle/add_curve_rectangle.zip