找到经过 N 个点的曲线的贝塞尔曲线控制点
考虑以下很好的解决方案来查找穿过 4 个点的曲线的三次贝塞尔控制点:
我想知道,是否有一个简单的扩展,可以使 Bézier 曲线穿过 N 个点,对于 N > 2 个点。 2 或许 N ≤ 20?
Considering the following nice solution for finding cubic Bézier control points for a curve passing through 4 points:
I wonder, if there is a straightforward extension to this for making the Bézier curve pass through N points, for N > 2 and maybe N ≤ 20?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是一个非常古老的问题,但我将其留给将来有相同问题的人。
@divanov 提到,当 N > 4 时,不存在通过 N 个任意点的贝塞尔曲线。
我认为OP问的是如何计算控制点来连接多个贝塞尔曲线以产生一条看起来平滑的曲线。
此 pdf 将向您展示如何计算控制点: http ://www.math.ucla.edu/~baker/149.1.02w/handouts/dd_splines.pdf
我在这篇文章中找到了https://developer.squareup.com/blog/smoother-signatures/ 来自 Square 关于他们如何渲染一条平滑的曲线,该曲线穿过鼠标绘制签名的所有采样点。
This is a really old question, but I'm leaving this here for people who have the same question in the future.
@divanov has mentioned that there's no Bezier curve passing through N arbitrary points for N >4.
I think the OP was asking how to compute the control points to join multiple bezier curves to produce a single curve that looks smooth.
This pdf will show you how to compute the control points: http://www.math.ucla.edu/~baker/149.1.02w/handouts/dd_splines.pdf
which I found on this writeup https://developer.squareup.com/blog/smoother-signatures/ from Square about how they render a smooth curve that passes through all the sampled points of a mouse drawn signature.
一般来说,不存在经过N个任意点的贝塞尔曲线,其中N>1。 4. 应考虑曲线拟合,以最小化计算的贝塞尔曲线与给定 N 个数据点之间的最小二乘误差。例如,此处进行了讨论。
In general, there is no Bezier curve passing through N arbitrary points, where N > 4. One should consider curve fitting to minimize least square error between computed Bezier curve and given N data points. Which is discussed, for example, here.