adamwulf / ClippingBezier

ClippingBezier calculates intersection points, paths, and shapes between two UIBezierPaths
http://getlooseleaf.com/opensource/
MIT License
256 stars 34 forks source link

[WIP] Experiment/alt bisect #18

Closed adamwulf closed 1 year ago

adamwulf commented 3 years ago

alternative algorithm for bisecting paths. this will bisect both paths, recurring by splitting the larger of the two paths and ignoring any path ranges that don't overlap

julsh commented 3 years ago

Interesting! How does performance of this compare against the baseline?

adamwulf commented 3 years ago

Just merged master into this branch, and did a re-test of all the performance tests for both the baseline and this branch. Overall this looks like a solid win. For all of the long-running tests that work on lots of combined data, this did between 8% - 30% better. For very long scribbled eraser strokes, it did nearly 50% better! Out of the 30 tests, it did 24 better and 6 worse. and all of the worse tests completed in less than 0.3s, so there's a higher variability there.

This feels like a fairly significant change. I wonder if it'd be worth collecting even more user data and expanding our performance test suite. 30 tests from 1 user is ok, but i'd love 100 or 200 tests from a few handfuls of people before saying it's definitely better and equally accurate/safe/etc.

adamwulf commented 3 years ago

Added some more test cases from the ink you scraped. It's interesting, some of the tests like testScraped35_board_0908 show no improvement. Others likes testScraped41_board_bebc or testScraped15_board_6b3f are 10% or 20% better respectively. and even others testScraped57_board_98a9 and testScraped48_board_52bf are 50% and 10% worse!

When we get to the mixing strategies phase, it'll be worth taking a deeper look into this and seeing if we can tease out which types of ink/eraser work best with each strategy.