How to redistribute points evenly over a curve

后端 未结 4 1715
伪装坚强ぢ
伪装坚强ぢ 2020-12-30 18:08

I have some arbitrary curve in 3 dimensions made up of a list of XYZ cartesian points. The points are not evenly distributed (theres a time factor). How can I \'rebuild\'

4条回答
  •  梦毁少年i
    2020-12-30 18:21

    Your "curve" is a bunch of line-segments that connect a bunch of points. Each line-segment has a length; the total length of your curve is the sum of these line-segments' lengths.

    So calculate d = totalCurveLength / (numberOfPoints - 1), and split the curve into (numberOfPoints - 1) chunks of length d.

提交回复
热议问题