0

I have a cubic Bézier curve defined by f(t) where t is in the interval [0..1], and I have approximated the Bézier curve with an n + 1 vertex polyline represented in an array called p, each vertex being p[i] for i in 0..n, where p[i] = f(i / n)

However, the points in the polyline are not actually the same distance from eachother. The distance between p[i] and p[i+1] varies over the length of the curve. I want to make the distances between all of the points in p the same.

How do I do this?

markt1964
  • 2,638
  • 2
  • 22
  • 54
  • Why do you want the distance between p[I] and p[I+1} to be the same? Typically, doing so not only increase computation complexity, the result you get will not be a better approximation to the original curve if you allow the distance to vary. – fang Sep 09 '16 at 00:29
  • I'm quite sure that the reason why I want to do this would not make any difference to an answer to the problem. It is for visual aesthetics only, because otherwise typically the individual vertices get more bunched together in about the middle of the curve than at the ends, or vice versa. If they are equally spaced, the result looks better. There's nothing more to it than that. – markt1964 Sep 11 '16 at 14:42
  • 1
    Rather than a long answer, I'll point you to http://pomax.github.io/bezierinfo/#tracing where I cover that problem off-site. – Mike 'Pomax' Kamermans Sep 23 '16 at 16:56
  • +1 Pomax's comment above. I think this has been asked before a few times. Here is an answer with a demo in javascript (mainly shows interpolation techniques). http://stackoverflow.com/questions/35275073/uniform-discretization-of-bezier-curve/35277050#35277050 – hkrish Sep 27 '16 at 16:40

0 Answers0