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>
@@ -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:2;stroke-linecap:round;stroke-linejoin:round" d="M 24.477098604512,9.669417777521 C 14.819439929541,11.947535742517 12.676649436509,16.038615428837 14.333890728881,19.259441941784 A 14.414713000000 14.414713000000 0.000000000000 0 1 24.000000000000,15.538198000000 A 14.414713000000 14.414713000000 0.000000000000 0 1 33.122169882593,18.791819319278 C 34.069717470896,15.767492825406 31.940527089963,12.079149310707 24.477098604560,9.669417777522"/>
|
||||
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 742 B |
@@ -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:2;stroke-linecap:round;stroke-linejoin:round" d="M 24.477098604512,9.669417777521 C 14.819439929541,11.947535742517 12.676649436509,16.038615428837 14.333890728881,19.259441941784 A 14.414713000000 14.414713000000 0.000000000000 0 1 24.000000000000,15.538198000000 A 14.414713000000 14.414713000000 0.000000000000 0 1 33.122169882593,18.791819319278 C 34.069717470896,15.767492825406 31.940527089963,12.079149310707 24.477098604560,9.669417777522"/><path style="fill:#ff0000;stroke:#000000;stroke-width:2;stroke-linecap:round;stroke-linejoin:round" d="M 33.122169882593,18.791819319278 A 14.414713000000 14.414713000000 0.000000000000 0 0 24.000000000000,15.538198000000 A 14.414713000000 14.414713000000 0.000000000000 0 0 14.333890728979,19.259441941746 C 15.689970608910,21.894965236658 19.590455736640,23.947789000000 24.000000000000,23.947789000000 C 28.530465205736,23.947789000000 32.220212847621,21.670632574670 33.122169882598,18.791819319326"/>
|
||||
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
@@ -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:2;stroke-linecap:round;stroke-linejoin:round" d="M 24.477098604512,9.669417777521 C 14.819439929541,11.947535742517 12.676649436509,16.038615428837 14.333890728881,19.259441941784 A 14.414713000000 14.414713000000 0.000000000000 0 1 24.000000000000,15.538198000000 A 14.414713000000 14.414713000000 0.000000000000 0 1 33.122169882593,18.791819319278 C 34.069717470896,15.767492825406 31.940527089963,12.079149310707 24.477098604560,9.669417777522 M 33.122169882598,18.791819319326 C 32.220212847621,21.670632574670 28.530465205736,23.947789000000 24.000000000000,23.947789000000 C 19.590455736640,23.947789000000 15.689970608910,21.894965236658 14.333890728881,19.259441941784 A 14.414713000000 14.414713000000 0.000000000000 0 0 9.585287100000,29.952911000000 A 14.414713000000 14.414713000000 0.000000000000 0 0 24.000000000000,44.367624000000 A 14.414713000000 14.414713000000 0.000000000000 0 0 38.414713000000,29.952911000000 A 14.414713000000 14.414713000000 0.000000000000 0 0 33.122169882593,18.791819319278"/>
|
||||
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
@@ -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:2;stroke-linecap:round;stroke-linejoin:round" d="M 24.477098604512,9.669417777521 C 14.819439929541,11.947535742517 12.676649436509,16.038615428837 14.333890728881,19.259441941784 A 14.414713000000 14.414713000000 0.000000000000 0 1 24.000000000000,15.538198000000 A 14.414713000000 14.414713000000 0.000000000000 0 1 33.122169882593,18.791819319278 C 34.069717470896,15.767492825406 31.940527089963,12.079149310707 24.477098604560,9.669417777522"/><path style="fill:#ff0000;stroke:#000000;stroke-width:2;stroke-linecap:round;stroke-linejoin:round" d="M 33.122169882598,18.791819319326 C 32.220212847621,21.670632574670 28.530465205736,23.947789000000 24.000000000000,23.947789000000 C 19.590455736640,23.947789000000 15.689970608910,21.894965236658 14.333890728881,19.259441941784 A 14.414713000000 14.414713000000 0.000000000000 0 0 9.585287100000,29.952911000000 A 14.414713000000 14.414713000000 0.000000000000 0 0 24.000000000000,44.367624000000 A 14.414713000000 14.414713000000 0.000000000000 0 0 38.414713000000,29.952911000000 A 14.414713000000 14.414713000000 0.000000000000 0 0 33.122169882593,18.791819319278"/><path style="fill:#ff0000;stroke:#000000;stroke-width:2;stroke-linecap:round;stroke-linejoin:round" d="M 33.122169882593,18.791819319278 A 14.414713000000 14.414713000000 0.000000000000 0 0 24.000000000000,15.538198000000 A 14.414713000000 14.414713000000 0.000000000000 0 0 14.333890728979,19.259441941746 C 15.689970608910,21.894965236658 19.590455736640,23.947789000000 24.000000000000,23.947789000000 C 28.530465205736,23.947789000000 32.220212847621,21.670632574670 33.122169882598,18.791819319326"/>
|
||||
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
@@ -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:2;stroke-linecap:round;stroke-linejoin:round" d="M 33.122169882593,18.791819319278 A 14.414713000000 14.414713000000 0.000000000000 0 0 24.000000000000,15.538198000000 A 14.414713000000 14.414713000000 0.000000000000 0 0 14.333890728979,19.259441941746 C 15.689970608910,21.894965236658 19.590455736640,23.947789000000 24.000000000000,23.947789000000 C 28.530465205736,23.947789000000 32.220212847621,21.670632574670 33.122169882598,18.791819319326"/>
|
||||
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 744 B |
@@ -0,0 +1,16 @@
|
||||
<?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:2;stroke-linecap:round;stroke-linejoin:round"
|
||||
d="M 3.2052288,7.1229882 C 42.417605,7.1229882 36.314629,23.947789 24,23.947789 11.685371,23.947789 3.3410435,7.9372144 43.299408,7.9372144"
|
||||
id="a"/>
|
||||
<path id="b"
|
||||
style="fill:#ff0000;stroke:#000000;stroke-width:2;stroke-linecap:round;stroke-linejoin:round"
|
||||
d="M 38.414713,29.952911 A 14.414713,14.414713 0 0 1 24,44.367624 14.414713,14.414713 0 0 1 9.5852871,29.952911 14.414713,14.414713 0 0 1 24,15.538198 14.414713,14.414713 0 0 1 38.414713,29.952911 Z"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 861 B |
@@ -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:2;stroke-linecap:round;stroke-linejoin:round" d="M 24.477098604512,9.669417777521 C 14.819439929541,11.947535742517 12.676649436509,16.038615428837 14.333890728881,19.259441941784 A 14.414713000000 14.414713000000 0.000000000000 0 0 9.585287100000,29.952911000000 A 14.414713000000 14.414713000000 0.000000000000 0 0 24.000000000000,44.367624000000 A 14.414713000000 14.414713000000 0.000000000000 0 0 38.414713000000,29.952911000000 A 14.414713000000 14.414713000000 0.000000000000 0 0 33.122169882593,18.791819319278 C 34.069717470896,15.767492825406 31.940527089963,12.079149310707 24.477098604560,9.669417777522"/>
|
||||
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 911 B |