I want to compute the difference/intersection between two paths. By path I mean a list of points that can be created by the following actions on a graphics context:

  • move to x, y
  • line to x, y
  • Bézier to x, y

How could I do that? What's the best algorithm to compute the difference/intersection between two paths, A - B? What if there's a simplification where B is guaranteed to be a rectangle?

  • 1
    $\begingroup$ I don't think this is answerable. There are many possible ways one could define a distance between two paths. Without any way to select among from them, there's no way to answer. "best" is not a useful criterion because you haven't told us by what standard you plan to evaluate possible distance measures. I don't think this is an answerable question -- first, you need to figure out how you plan to measure distance, and what properties you want it to have. $\endgroup$ – D.W. Nov 19 '18 at 2:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.