1

假设我们有一些二维路径几何。是否有一种算法可以产生一条新路径,以如下类似的形式“包裹”几何图形?

原始路径 = 灰色。 新路径 = RED

效果应该类似于收缩包装后的对象的外观。提前致谢

4

1 回答 1

5

您可以尝试使用二次样条曲线,在凹面区域开始处的顶点处使用锚点,并在凹面区域内的某个位置使用控制点。

控制点的位置必须根据当地的几何形状来确定。

像这样的东西,也许?

在此处输入图像描述

该算法可以是:

1- find the convex hull  
2- for each concave segment (where the convex hull doesn't match the polygon path):  
    2a - id the start and end point as anchors  
    2b - id a control point position
    2c - trace a quadratic spline using these points
于 2019-06-10T04:33:08.477 回答