skia-pathops icon indicating copy to clipboard operation
skia-pathops copied to clipboard

pathops turns cubics into quadratics

Open simoncozens opened this issue 2 years ago • 0 comments

Test case:

from ufoLib2.objects import Contour, Point, Glyph
from pathops import union
ufo_glyph = Glyph()
pen = ufo_glyph.getPen()
contours = [
   Contour(points=[
   Point(371, 515, type='curve'),
   Point(414, 515),
   Point(443, 490),
   Point(445, 434, type='curve'),
   Point(447, 379),
   Point(447, 323),
   Point(445, 266, type='curve'),
   Point(443, 210),
   Point(415, 185)])]
union(contours, pen)
print([node.type for node in ufo_glyph[0]])
# ['curve', None, None, 'curve', None, 'qcurve', None, None]
assert not any(node.type == "qcurve" for node in ufo_glyph[0])

simoncozens avatar Oct 20 '23 19:10 simoncozens