Brief Introduction of Bezier Curve and Bspline: B-spline (1)
1.什么是B-spline
Bezier Curve的缺点主要是:
- nonlocality,移动一个控制点会影响整条曲线
- 高阶曲线,曲线离控制点很远
对此,可以把N条Bezier Curve组合起来。如下图所示,是两条3次Bezier Curve在D点连接而得。

此时,该曲线是一条曲线,共有7个控制点。若想得到一条曲线,则需要两条Bezier Curve在D点的导数相同。通过Bezier Curve的导数表达式,可知需要C,D,E点共线并且。此时D点失去了控制作用,共用6个控制点,如下图所示。

进一步地,若想得到一条曲线,则需要D点的二阶导数相同。那么此时需要又一个控制点失去作用,例如E点,如下图所示。

可见,N条3阶Bezier Curve拼接成一条曲线,需要个控制点;一条曲线需要个控制点;一条曲线需要个控制点。
进而,N条k阶的Bezier Curve拼接成一条连续的B-spline曲线需要N+k个控制点。
但值得注意的是,在上图中,A,B,C,F,G并不是B-spline的控制点,控制点应该是下图的S0-S4。
B-spline具有局部性,例如移动S0,并不会对第二段Bezier Curve产生影响。同样地,移动S4,也不会对第一段Bezier Curve产生影响。B-spline的性质可总结为:
- The curve starts and ends at the first and last control vertices.
- The curve is tangent to the first and last edges of its control polygon.
- The B-spline curve is contained in the convex hull of its control polygon. 如下图所示。
- If the B-spline curve is of degree n, it is contained in the union of the convex hulls of every n+1 consecutive vertices. 如下图所示。
- The shape of the B-spline curve is roughly the same as the shape of its control polygon.
- The B-spline curve twists less than its control polygon. 如下图所示。
- Moving a vertex of the control polygon affects only a part of the curve close to the vertex moved.
- The B-spline curve can be translated, rotated or reflected, by translating, rotating, or reflecting the vertices of its control polygon.
2.B-spline表达式
由N条k阶的Bezier Curve组成k阶B-spline曲线有N+k个控制点。B-spline的表达式可以写为:
当N=3,k=3时,对应的6个基函数如下图所示。
可见,基函数的有效区间,即值不为零的区间是[0,1],基函数的有效区间是[0,2]。
The knots of a B-spline curve are the endpoints of the supports of the basis functions that define the curve. 这6个基函数的knots为:
The knot vector comprises the knots of the basis functions that define a S-spline curve, listed from smallest to largest. 上方B-spline对应的knot vector为。
N条k阶Bezier Curve组成的k阶B-spline曲线对应的knot vector为:
3.Cox-de boor formula
要想根据控制点生成B-spline,需要计算出相应的基函数。本小节就是一种用knot vector递归计算出基函数的算法。以上方的3阶B-spline为例,他的思想就是通过和得到,以及通过和得到,进而通过和得到,如此递归地得到。
计算公式如下: 并且 以及,以及分母为0,则为0。
python代码详见:https://github.com/LiuLarissa/bezier_and_bspline_generator/blob/master/bspline_generator.py
4.B-spline的微分
针对B-spline如下的表达式: 基函数的一阶导数为: 则B-spline的一阶导数为: 式(6)中的第一项和最后一项为0,则 其中: 可见,一条k阶的B-spline的导数是另一条k-1阶的B-spline,控制点则变为了,少了一个。针对这条k-1阶的B-spline,其knot vector就是之前的knot vector去掉第一个和最后一个元素。那么针对新的knot vector,B-spline的微分可以写为:
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· Manus的开源复刻OpenManus初探
· AI 智能体引爆开源社区「GitHub 热点速览」
· 从HTTP原因短语缺失研究HTTP/2和HTTP/3的设计差异
· 三行代码完成国际化适配,妙~啊~