问题描述
我有两条三次贝塞尔曲线,
I have two cubic bezier curve,
曲线1:-:第一锚点(a1x,a1y),第一控制点(c1x,c1y),第二控制点(c2x,c2y),第二锚点(a2x ,a2y)
curve 1:- 1st anchor-point(a1x,a1y), 1st control-point(c1x,c1y), 2nd control-point(c2x,c2y), 2nd anchor-point(a2x,a2y)
曲线2:-:第一锚点(a3x,a3y),第一控制点(c2x,c3y),第二控制点(c4x,c4y),第二锚点(a4x ,a4y)
curve 2:- 1st anchor-point(a3x,a3y), 1st control-point(c2x,c3y), 2nd control-point(c4x,c4y), 2nd anchor-point(a4x,a4y)
现在,我想找到这两条贝塞尔曲线之间的交点;
Now I want to find the intersection points between these two bezier curve;
该怎么做?任何带有算法的参考文件都会对我有所帮助;
How to do it?Any reference document with algorithm will help me;
推荐答案
找到Bezier曲线交点的主要方法有两种:
There are two main methods to find a Bezier curve intersection:
- 递归细分利用Bezier曲线的凸包属性,通常检查其曲线段的边界框的交集.
《 Graphics Gems IV》一书中的代码,带有一些文字说明
- 两个三次方程组的数值解.它导致9阶多项式方程,并且可能具有9个实根(两个S形曲线的情况).注意,该解在数值上是不稳定的.
JS代码和互动演示而且我认为C ++代码可能在几何工具 WildMagic库中.
JS code and interactive demonstrationAnd I think C++ code might be in Geometric Tools WildMagic library.
这篇关于如何找到两条三次贝塞尔曲线之间的交点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!