Checking if two cubic Bézier curves intersect

前端 未结 8 553
星月不相逢
星月不相逢 2020-12-04 14:42

For a personal project, I\'d need to find out if two cubic Bézier curves intersect. I don\'t need to know where: I just need to know if they do. However, I\'d need to do it

8条回答
  •  佛祖请我去吃肉
    2020-12-04 15:15

    Is it a mistake on my end or on their end?

    Are you basing your interpretation of the determinant on the 4th comment attached to this answer? If so, I believe that's where the mistake lies. Reproducing the comment here:

    If the determinant is zero there is is a root in X and Y at *exactly the same value of t, so there is an intersection of the two curves. (the t may not be in the interval 0..1 though).

    I don't see any problems with this part, but the author goes on to say:

    If the determinant is <> zero you can be sure that the curves don't intersect anywhere.

    I don't think that's correct. It's perfectly possible for the two curves to intersect in a location where the t values differ, and in that case, there will be an intersection even though the matrix has a non-zero determinant. I believe this is what's happening in your case.

提交回复
热议问题