35 Commits

Author SHA1 Message Date
Behdad Esfahbod
caa0c81b73 [qu2cu] Better initial condition 2023-02-20 12:25:37 -07:00
Behdad Esfahbod
94ee47c6e4 [qu2cu] Add a test and fix a bug 2023-02-20 12:22:16 -07:00
Behdad Esfahbod
789f45d4ee [qu2cu] Improve docs 2023-02-20 10:41:13 -07:00
Behdad Esfahbod
90a2a80524 Revert "Revert "[qu2cu] Add an optimization""
This reverts commit eec3dca58a762cddb8f4315e2c8591ca4aecf7d4.

The optimization is correct now.

It brings down the Cythonized benchmark from 1400us to 1100us.
2023-02-20 10:31:23 -07:00
Behdad Esfahbod
68c735aa76 [qu2cu] Fix optimization
4 wouldn't have caused problem really but 3 is correct.
2023-02-20 10:29:48 -07:00
Behdad Esfahbod
51ed6c151f [qu2cu] More annotation 2023-02-20 10:25:28 -07:00
Behdad Esfahbod
95692c29df [qu2cu] Tweak annotation again 2023-02-20 10:21:12 -07:00
Behdad Esfahbod
eec3dca58a Revert "[qu2cu] Add an optimization"
This reverts commit 97caa108c871522058a159a46342cedbe61a4650.

This was wrong, and made the test fail indeed. I'll think to see
if I can come up with a proper one.
2023-02-20 10:19:50 -07:00
Behdad Esfahbod
702265a760 [qu2cu] Fixup annotation 2023-02-20 10:19:21 -07:00
Behdad Esfahbod
6028fee260 [qu2cu] Rename tolerance to max_err
To match cu2qu.
2023-02-20 10:16:34 -07:00
Behdad Esfahbod
dd080d473a [qu2cu] Improve docs 2023-02-20 10:15:50 -07:00
Behdad Esfahbod
97caa108c8 [qu2cu] Add an optimization 2023-02-20 10:08:33 -07:00
Behdad Esfahbod
34a3f90859 [qu2cu] Typo 2023-02-20 10:07:31 -07:00
Behdad Esfahbod
d0896ac296 [qu2cu] Simplify API
Drop the one that was special-case of the other.
2023-02-20 10:03:30 -07:00
Behdad Esfahbod
f58a17d6e9 [qu2cu] Document new API 2023-02-20 09:50:52 -07:00
Behdad Esfahbod
b73ff5f171 [qu2cu] Use collections.namedtuple instead, to make cython bot happy 2023-02-20 08:45:25 -07:00
Behdad Esfahbod
837448d428 [qu2cu] Document what costs parameter is 2023-02-20 08:22:35 -07:00
Behdad Esfahbod
b3be1883c8 [qu2cu] Use NamedTuple for solution 2023-02-20 08:17:24 -07:00
Behdad Esfahbod
f1086ddb65 [qu2cu] Produce optimal mix of cubic/quadratic splines
Yay. Finally!
2023-02-18 16:36:43 -07:00
Behdad Esfahbod
6e1f53f101 [qu2cu.qu2cu] Call main 2023-02-18 09:46:56 -07:00
Behdad Esfahbod
74cab7ae1f [qu2cu] Fix 2023-02-18 09:46:56 -07:00
Behdad Esfahbod
ea8ae8f399 Black 2023-02-18 09:46:56 -07:00
Behdad Esfahbod
ceae682246 [qu2cu] Add all_cubic parameter 2023-02-18 09:46:56 -07:00
Behdad Esfahbod
1a10b05c99 [qu2cuPen] Process multiple qCurveTo's at a time 2023-02-18 09:46:56 -07:00
Behdad Esfahbod
aa468c1c88 [qu2cu] Add quadratics_to_curves()
Untested.
2023-02-18 09:46:56 -07:00
Behdad Esfahbod
3a3b8af154 [qu2cu] Comment 2023-02-18 09:46:56 -07:00
Behdad Esfahbod
9a7e042f01 [qu2cu] Speed up cubic_farthest_fit_inside 2023-02-18 09:46:56 -07:00
Behdad Esfahbod
aa6f60942b [qu2cu] More Cython annotations 2023-02-18 09:46:56 -07:00
Behdad Esfahbod
86e6c55c95 black 2023-02-18 09:46:56 -07:00
Behdad Esfahbod
085872d2bc [qu2cu] Speed up using generator splitCubicAtTC 2023-02-18 09:46:56 -07:00
Behdad Esfahbod
0013740ab3 [qu2cu] Copy a function from cu2qu, to make Cython happy 2023-02-18 09:46:56 -07:00
Behdad Esfahbod
2a54dc5742 [qu2cu] Comment 2023-02-18 09:46:56 -07:00
Behdad Esfahbod
3c294d17cf [qu2cu] Speed up 2023-02-18 09:46:56 -07:00
Behdad Esfahbod
710da53b8e [qu2cu] Use a better algorithm
Dynamic-programming. Produces fewer number of curves.
2023-02-18 09:46:56 -07:00
Behdad Esfahbod
83398db061 [qu2cu] Add new module to convert quadratic to cubic Beziers 2023-02-18 09:46:56 -07:00