Approximate a curve with a limited number of line segments and arcs of circles

后端 未结 3 514
清酒与你
清酒与你 2020-12-18 09:29

Is there any algorithm that would allow to approximate a path on the x-y plane (i.e. an ordered suite of points defined by x and y) with a limited number of line segments an

3条回答
  •  [愿得一人]
    2020-12-18 10:10

    the C1 requirement demands the you must have alternating straights and arcs. Also realize if you permit a sufficient number of segments you can trivially fit every pair of points with a straight and use a tiny arc to satisfy slope continuity.

    I'd suggest this algorithm,

    1 best fit with a set of (specified N) straight segments. (surely there are well developed algorithms for that.)

    2 consider the straight segments fixed and at each joint place an arc. Treating each joint individually i think you have a tractable problem to find the optimum arc center/radius to satisfy continuity and improve the fit.

    3 now that you are pretty close attempt to consider all arc centers and radii (segments being defined by tangency) as a global optimization problem. This of course blows up if N is large.

提交回复
热议问题