pipe script but rectangle

 From:  Andrei Samardac
6472.1 
Is it any script that works like pipe script but make rectangle not tube?
And how to draw rectangle from center on the end of curve to make it perpendicular?