The intersection point between a spline and a line

自作多情 提交于 2019-12-17 22:55:25

问题


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.


回答1:


The most efficient algorithm that I've heard of is called Bezier clipping.

Here's a book chapter on curve and spline intersection (pdf).




回答2:


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.




回答3:


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.



来源:https://stackoverflow.com/questions/234261/the-intersection-point-between-a-spline-and-a-line

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!