2D-Cubic splines are given in parametric form (X(t), Y(t) and X(s), Y(s)). Every segment has it's own X and Y expression. And I want to find all intersection points. Some segments are intersecting some aren't.
At first I solved this problem using "line intersections method". Which has the simple idea of splitting a chosen pair of spline segments into 50-100 small subsegments and then intersection point was found by calculating both curves points vector and comparing the values of X(p),X(s) and Y(p) with Y(s).
It worked but it was not the solution I was looking for because it had two major flaws. First, it's slow even with "overlapping test" before comparison loop and the second problem was it could skip intersection point if it's too close to the previous one.
Is there a way to: 1) find if an intersection point is in the given parameter ranges (tmin, tmax) and (smin,smax) of two splines. 2) find an exact values of s and p at the intersection point.
I would like using analytic method if it exists. However the second part can be done iteratively but we have to know how many points are to find.
I understand that this is not a kind of question that has a short answer. I would appreciate it if you could provide the books titles (and author names) or other links and references to read about the good solution of this problem (2D cubic curves intersection).