Circular approximation of polygon (or its part)

混江龙づ霸主 提交于 2019-11-28 14:16:45
  1. You can obtain curvature radius center for any 2 line segments

    1. find the lines midpoints
    2. cast perpendicular lines from each (red lines)
    3. find the intersection (it is the center of the curvature)

    In 3D use plane of the object (3 lines not 2). The radius is just distance between center and the lines joint point (blue line). If radius is too big then handle both lines as single line (no intersection or too far intersection)

  2. compute all segments like in #1

  3. join arcs with the same radius and center to single arc if joined

  4. handle the changing curvature

    if the arc is changing the center or radius do it like in this picture

    first segment does not have previous line so use the next instead that cause the irregularity at start arc ...

That should cover all cases hope my hand-paint-drawings are making sense ...

If your circular arcs must start and end on given endpoints, then the center point will be somewhere on the mediatrix and there remains a single degree of freedom.

So you can use the least squares method to find a best fit: assume you know the radius, which gives you the center, and compute the sum of squared distances of the remaining vertices to the circumference (distance to the center minus radius). The best fit is the one that minimizes that sum. Let's hope that there is an analytical solution.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!