贝塞尔曲线连接 [英] bezier curve joining

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

问题描述

我在空间上相隔一定距离放置了两条贝塞尔曲线.
曲线1具有控制点A0,A1,A2,A3. A0和A3位于曲线上,并且是端点
曲线2具有控制点C0,C1,C2,C3. C0和C3位于曲线上,并且是端点

我想将两条曲线A和C与中间贝塞尔曲线B连接起来.中间曲线B具有控制点A3和C0,它们位于曲线上并作为端点.我不知道中间控制点B1和B2.连接也应该足够平滑.请就如何进行提供帮助.已经阅读过很多关于贝塞尔曲线的信息,但不知道如何做.
感谢和问候,
zoya

i have two bezier curves placed at a distance apart in space.
curve 1 has control points A0, A1,A2, A3. A0 and A3 lie on curve and are its end points
Curve 2 has control points C0,C1, C2, C3 . C0 and C3 lie on curve.and are its end points

i want to join the two curves A and C with an intermediate bezier curve B. the intermediate Curve B has control points A3 and C0 which lie on the curve and are its end points. theintermediate control points B1 and B2 are unknown to me. also the joining should be smooth enough. please help as to how to proceed. have read alot about beziers but dont know how to do this.
thanks and regards,
zoya

推荐答案

离开B0 = A3B3 = C0确保 G0 的连续性(位置).选择B1A2A3共线可确保 G1 B0处的连续性(方向),类似地选择B2C0C1共线可确保 G1 B3处的连续性.

现在,B1B2的放置仍然有两个自由度.我猜这些也可以用来实现 G2 的连续性(曲率).

现在一点数学.在以下文档中 http://www.tsplines.com/resources/class_notes/Bezier_curves.pdf [ ^ ],您会在第22页上找到一个有趣的公式,告诉您曲率等于h/a^2(去掉常数n-1/n),其中a是控制多边形的第一条边的长度,而h是从第二个控制点到目标点的垂直距离.控制多边形的第一条腿.

我们声明B1 = B0 + a UB2 = B3 + a'' V,其中UV分别是在B0B1B3B2方向上的单位矢量.通过将B1B2投影到UV上获得hh'':h = B1B2 /\ U = (B0B3 + a'' V) /\ U = p + q a''h'' = B1B2 /\ V = (B0B3 + a U) /\ V = p'' - q a. (/\是矢量乘积运算符,二维中2x2的行列式).

可以将其与从其他两个弧线计算出的端点处的已知曲率放在一起:
h = K a^2h'' = K'' a''^2.

消除三个未知数可以使我们在a中得到四次方程,因此有0到4个解.

Letting B0 = A3 and B3 = C0 ensures G0 continuity (location). Choosing B1 to be collinear with A2A3 will ensure G1 continuity (direction) at B0, and similarly choosing B2 to be collinear with C0C1 ensures G1 continuity at B3.

Now there remain two degrees of freedom for the placement of B1 and B2. I guess that these can be used to achieve G2 continuity (curvature) as well.

Now a little bit of math. In the following document http://www.tsplines.com/resources/class_notes/Bezier_curves.pdf[^], you find an interesting formula on page 22, telling you that the curvature equals h/a^2 (dropping the constant n-1/n), where a is the length of the first leg of the control polygon, and h is the perpendicular distance from the second control point to the first leg of the control polygon.

We state that B1 = B0 + a U and B2 = B3 + a'' V, where U and V are the unit vectors in the directions of B0B1 and B3B2 respectively. h and h'' are obtained by projecting B1B2 onto U and V: h = B1B2 /\ U = (B0B3 + a'' V) /\ U = p + q a'', h'' = B1B2 /\ V = (B0B3 + a U) /\ V = p'' - q a. (/\ is the vector product operator, a 2x2 determinant in 2D).

This can be put together with the known curvatures at endpoints computed from the other two arcs:
h = K a^2 and h'' = K'' a''^2.

Elimination of three unknowns gives us a quartic equation in a, hence 0 to 4 solutions.

p + q a'' = K a^2<br />
p'' - q a  = K'' a''^2<br />
<br />
=><br />
<br />
(p'' - q a) q^2 = K'' (K a^2 - p)^2



:-(



:-(


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

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