tharwat, how did you do it.
in the code i posted, the first part is yours that creates 1000 points.
that code always worked for me
.
in the other parts that are not working, i try to use just the vertexes off the polyline to keep the points low and have no troubles in the corners.
Did you used your code that takes a 1000 points or a other?