Add path-bool library (#1952)

* Add path-bool library

* Cleanup code

* Cargo format

* Integrate boolean ops into graphite

* Add test for editor crash

* Fix edge sort floating point instability

* Add unit test for red-dress failure

* Backport tests and aux functions

* Use curvature based sorting

* Convert linear cubic splines to line segments

* Deduplicate reversed path segments

* Fix epsilon for empty segments

* Remove parameter based intersection pruning

* Add support for reversed paths

* Add benchmark infrastructure

* Add intersection benchmark

* Add recursion bound

* Implement support for overlapping path segments

* Remove rouge prinln

* Fix sorting for bezier segments with one control point at the start of the segment

* Cleanup log statements

* Directly translate graphite paths to Path segments

* Round data before passing it to path_bool

* Fix flag_faces traversal order

* Add test for white dots in bottom right of painted dreams

* Make rounding configurable

* Update demo artwork to remove manual path modifications

* Convert from path segments to manipulator groups directly

* Remove dead code

* Fix clippy lints

* Replace functions in path segment with methods and add documentation

* Add more documentation

* Close subpaths

* Reorganize files and add README.md

* Add license information

* Code review

* Fix license info

* Adopt new node macro and fix demo artwork

* Close subpaths with Z

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Dennis Kobert
2024-09-21 02:06:43 -07:00
committed by GitHub
co-authored by Keavon Chambers
parent 2febbfd698
commit 3eb98c6d6d
165 changed files with 5990 additions and 78 deletions
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg width="48" height="48" viewBox="0 0 48 48" version="1.1" id="svg1" xmlns="http://www.w3.org/2000/svg">
<path style="fill:#ff0000;stroke:#000000;stroke-width:1.99937;stroke-linecap:round;stroke-linejoin:round" d="M 14.314589076864,18.409740195511 C 13.899012312978,19.140430517465 13.181190227505,19.805206705223 11.905987000000,20.640534000000 C 9.005844500000,22.540285000000 9.667362200000,23.422087000000 7.699704200000,25.524897000000 C 5.732046200000,27.627707000000 7.564220200000,28.916954000000 8.785228600000,32.512733000000 C 10.006236528989,36.108510612907 9.734938509310,36.108181000255 12.245190094964,38.143412644690 C 12.245191063309,38.143413429793 12.245192031654,38.143414214896 12.245193000000,38.143415000000 L 12.245190000000,38.143415000000 C 12.245222267819,38.142610192401 12.516645299334,31.374813030412 15.162226000000,29.256160000000 C 17.807964000000,27.137380000000 16.654864000000,27.017534000000 17.061977000000,25.457321000000 C 17.222754443760,24.841159839246 17.573963395790,23.301491455620 17.965172692919,21.560526935811 C 17.072561191361,20.587633996247 16.045837744328,19.637705487132 14.806130000000,18.740783000000 C 14.641414538294,18.621612169408 14.477548702869,18.511386411570 14.314589076583,18.409740195297 M 27.841329774700,32.743507113304 C 25.700294654507,34.271124699473 23.132944869744,34.318091925773 22.421361000000,34.208761000000 C 21.539558000000,34.073278000000 18.825582000000,34.547967000000 16.858255000000,37.057890000000 C 14.890928000000,39.567814000000 18.825582000000,42.213883000000 23.829031000000,42.892295000000 C 28.832481000000,43.570706000000 30.630205000000,42.078400000000 33.683056000000,40.517855000000 C 35.714484924788,39.479436730837 36.228249102949,37.498838478371 36.734854405102,35.317706227318 C 34.106942501694,34.986704099095 31.256102840078,34.373359242475 28.849709000000,33.258720000000 C 28.497185717607,33.095431572316 28.161636216697,32.923474205797 27.841329774653,32.743507113218"/>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB