转换贝塞尔曲线多边形链? [英] convert bezier curve to polygonal chain?

查看:127
本文介绍了转换贝塞尔曲线多边形链?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想拆分Bezier曲线为多边形链与正直线。线的数目依赖于2个连接线之间的最大允许角度。 我正在寻找一种算法来找到最优解(即降低尽可能的直线数)。

I want to split a bezier curve into a polygonal chain with n straight lines. The number of lines being dependent on a maximum allowed angle between 2 connecting lines. I'm looking for an algorithm to find the most optimal solution (ie to reduce as much as possible the number of straight lines).

我知道如何使用应用Casteljau或伯恩斯坦polynomals分裂Bezier曲线。我试图除以贝塞尔成半计算直线之间的角度,并再次分裂如果连接线之间的角度是一定的阈值范围内,但我可能会碰到的快捷方式。

I know how to split a bezier curve using Casteljau or Bernstein polynomals. I tried dividing the bezier into half calculate the angle between the straight lines, and split again if the angle between the connecting lines is within a certain threshold range, but i may run into shortcuts.

是否存在已知的算法或伪code可以做到这一点的转换?

Is there a known algorithm or pseudo code available to do this conversion?

推荐答案

使用去应用Casteljau递归算法,直至控制点大约共线。例如,见<一href="http://www.antigrain.com/research/adaptive_bezier/index.html">http://www.antigrain.com/research/adaptive_bezier/index.html.

Use de Casteljau algorithm recursively until the control points are approximately collinear. See for instance http://www.antigrain.com/research/adaptive_bezier/index.html.

这篇关于转换贝塞尔曲线多边形链?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆