I\'m using the algorithm below to generate quads which are then rendered to make an outline like this
http://img810.imageshack.us/img810/8530/uhohz.p
Ah, I see now. It's because you are reusing your old vertices, which aren't necessarily parallel to your new ones.
Just go through your code with a simple example by hand, where your input points take a sharp 90 degree turn. The old vertices will be parallel to dir
while the new ones will be perpendicular. If you have points on the line that are close enough together then you'll get strange behaviour like you see in your picture.
There's no "simple" solution to getting uniform width lines, but things would look better if you just render the lines a pair at a time (i.e. get rid of the i > 0
case). That will give you some ugly sharp corners, but you won't get any thin lines.