Checking if two cubic Bézier curves intersect

前端 未结 8 542
星月不相逢
星月不相逢 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:24

    I don't know how fast it will be, but if you have two curves C1(t) and C2(k) they intersect if C1(t) == C2(k). So you have two equations (per x and per y) for two variables (t, k). You can solve the system using numerical methods with enough for you accuracy. When you've found t,k parameters you should check if there is a parameter on [0, 1]. If it is they intersects on [0, 1].

提交回复
热议问题