fixed potential bug when vertex locations are supplied as single precision; improved smoothing function, adding iteration to make the output smoother