样条线和直线之间的交点
我正在尝试找到一种方法来计算 B 样条线和直线之间的交点。 到目前为止,谷歌还没有提供太多帮助。
I'm trying to find a way to calculate the intersection between a b-spline and a straight line. So far Google hasn't been much help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
纯数学方法:
如果这是你要走的路,我可以计算出必要的公式。
A pure mathematical approach:
If this is the way you are going I can work out the necessary formulas.
我听说过的最有效的算法称为贝塞尔曲线裁剪。
这是关于曲线和样条线相交的书籍章节 (pdf)。
The most efficient algorithm that I've heard of is called Bezier clipping.
Here's a book chapter on curve and spline intersection (pdf).
最好的方法可能是将样条线分解为单独的线段,并测试每个线段与线的相交。 样条曲线可能与直线相交不止一个点,因此您还必须决定对哪一个点感兴趣。
Your best approach might be to break down your spline into individual line segments and test each line segment for intersection with the line. The spline may intersect the line in more than one point, so you'll also have to decide which one you're interested in.