样条线和直线之间的交点

发布于 2024-07-08 01:32:50 字数 56 浏览 7 评论 0原文

我正在尝试找到一种方法来计算 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

因为看清所以看轻 2024-07-15 01:32:50

纯数学方法:

  • 变换样条曲线和直线,使直线位于 X 轴上。
  • 计算样条曲线上 Y = 0 的点(取决于样条曲线的阶数)。
  • 将这些点转换回原始坐标系。

如果这是你要走的路,我可以计算出必要的公式。

A pure mathematical approach:

  • Transform the spline and the line so that the line lies on the X axis.
  • Calculate the points on the spline where Y = 0 (depends on the order of the spline).
  • Transform these points back to your original cordinate system.

If this is the way you are going I can work out the necessary formulas.

我的鱼塘能养鲲 2024-07-15 01:32:50

我听说过的最有效的算法称为贝塞尔曲线裁剪。

这是关于曲线和样条线相交的书籍章节 (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).

莫言歌 2024-07-15 01:32:50

最好的方法可能是将样条线分解为单独的线段,并测试每个线段与线的相交。 样条曲线可能与直线相交不止一个点,因此您还必须决定对哪一个点感兴趣。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文