computational geometry - Reliable test for intersection of two Bezier curves -


how reliably find out whether 2 bezier curves intersect? "reliably" mean test answer "yes" when curves intersect, , "no" when don't intersect. don't need know parameters intersection found at. use floating-point numbers in implementation.

i found several answers here use curves' bounding-boxes test: not i'm after such test may report intersection if curves don't intersect.

the closest thing found far "bounding wedge" sederberg , meyers "only" distinguishes between at-most-one , two-or-more intersection, whereas want know if there at-most-zero , one-or-more intersections.

i assuming cubic bezier curves.

the reliable method reporting intersections, using floating point computation, find them, combined error analysis.

the main problem, when floating point computations involved, inconsistency in computed results w.r.t. topology. unfortunately unavoidable, if need compute in computational geometry within reasonable amount of time.

so instead of stressing on right algorithm intersection calculation, picking simple 1 , implementing error analysis solution.

i try implement efficient subdivision algorithm bezier-clipping (or variant of quadratic clipping –nicholas north's geo-clip), , running error analysis compute tight error bounds don't "miss" intersections.

to elaborate, main sources of floating-point (double prec.) error in these subdivision based algorithms are:

  1. truncation error: error in input coefficients etc. finite —we can't here within algorithm.
  2. roundoff error during de casteljau subdivision , point evaluation.

i have used running error bounds de casteljau's algorithm —explained here, along geo-clip algorithm. fast , robust. (b.t.w. theses, in general, read if want make polynomial/bezier algorithms more robust)

assuming, know basics of bezier clipping algorithm, general idea expand hybrid bezier curve (in first paper linked) , fat line appropriately error bounds each clip.

some other unrelated ideas:

  • you can try variant of bentley-ottmann sweepline algorithm. first have split bezier curves x monotone segments; , @ y orderings sweep across them. method has few disadvantages, since bezier curves capable of intersecting multiplicity of more 1 - think of tangential intersection. doing error analysis may difficult here (when compute y value, there floating point error involved)
  • interval projected polyhedron algorithm: uses rounded interval arithmetic robustness. algorithm 2d bezier curves gets quite complicated

there few cases might come across:

  1. self intersections
  2. overlapping (coincident) curves: subdivision algorithms keep going in case. can easy to check though.

good luck :)


Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -