3
votes

I have two Bezier curves which share an end point. Each of these curves has an "extension" on both the left and right sides, similar to the edges of a road. The extensions are made of line segments that approximate the Bezier curve.

I want to find the closest intersection point of these paths to the shared end point of the bezier curves.

Here is a diagram I've drawn of the problem

Each line path has over 100 vertices, so intersecting each line and keeping the closest intersection point can become very slow, given that this must run in real-time.

I've run a bounding sphere intersection test on the lines before checking for an intersection point to speed things up a little, but it's still not quick enough. My next approach would be to use some sort of quadtree structure.

I've looked up the Bentley-Ottmann algorithm but it seems to deal with finding all intersections in one set of lines, which isn't what I need. I've also looked up Bezier curve intersection algorithms but they seem to require subdivision into line segments, which I already have.

Are there any useful algorithms for this problem, or perhaps any ideas on how it might be optimised?

1
Why the closest intersection point and not the only one? Is there a possibility that A and B meet on more than one intersection point?saastn

1 Answers

0
votes

Given two curves A and B with extension widths Aw and Bw. Find the point A' which is the distance Bw along A from the shared node N. Find the point B' which is likewise the distance Aw along B from the shared node N. Now, given the points N, A' and B', find the fourth point N' which forms a parallelogram with the other three nodes. This point N' is the intersection.