fonttools 4.58.2__cp310-cp310-win_amd64.whl → 4.58.3__cp310-cp310-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of fonttools might be problematic. Click here for more details.
- fontTools/__init__.py +1 -1
- fontTools/cu2qu/cu2qu.c +280 -92
- fontTools/cu2qu/cu2qu.cp310-win_amd64.pyd +0 -0
- fontTools/feaLib/ast.py +2 -2
- fontTools/feaLib/lexer.c +238 -62
- fontTools/feaLib/lexer.cp310-win_amd64.pyd +0 -0
- fontTools/misc/bezierTools.c +390 -202
- fontTools/misc/bezierTools.cp310-win_amd64.pyd +0 -0
- fontTools/pens/momentsPen.c +222 -46
- fontTools/pens/momentsPen.cp310-win_amd64.pyd +0 -0
- fontTools/qu2cu/qu2cu.c +293 -105
- fontTools/qu2cu/qu2cu.cp310-win_amd64.pyd +0 -0
- fontTools/varLib/iup.c +260 -72
- fontTools/varLib/iup.cp310-win_amd64.pyd +0 -0
- {fonttools-4.58.2.dist-info → fonttools-4.58.3.dist-info}/METADATA +6 -1
- {fonttools-4.58.2.dist-info → fonttools-4.58.3.dist-info}/RECORD +22 -22
- {fonttools-4.58.2.data → fonttools-4.58.3.data}/data/share/man/man1/ttx.1 +0 -0
- {fonttools-4.58.2.dist-info → fonttools-4.58.3.dist-info}/WHEEL +0 -0
- {fonttools-4.58.2.dist-info → fonttools-4.58.3.dist-info}/entry_points.txt +0 -0
- {fonttools-4.58.2.dist-info → fonttools-4.58.3.dist-info}/licenses/LICENSE +0 -0
- {fonttools-4.58.2.dist-info → fonttools-4.58.3.dist-info}/licenses/LICENSE.external +0 -0
- {fonttools-4.58.2.dist-info → fonttools-4.58.3.dist-info}/top_level.txt +0 -0
fontTools/misc/bezierTools.c
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Generated by Cython 3.1.
|
|
1
|
+
/* Generated by Cython 3.1.2 */
|
|
2
2
|
|
|
3
3
|
/* BEGIN: Cython Metadata
|
|
4
4
|
{
|
|
@@ -26,8 +26,8 @@ END: Cython Metadata */
|
|
|
26
26
|
#elif PY_VERSION_HEX < 0x03080000
|
|
27
27
|
#error Cython requires Python 3.8+.
|
|
28
28
|
#else
|
|
29
|
-
#define __PYX_ABI_VERSION "
|
|
30
|
-
#define CYTHON_HEX_VERSION
|
|
29
|
+
#define __PYX_ABI_VERSION "3_1_2"
|
|
30
|
+
#define CYTHON_HEX_VERSION 0x030102F0
|
|
31
31
|
#define CYTHON_FUTURE_DIVISION 1
|
|
32
32
|
/* CModulePreamble */
|
|
33
33
|
#include <stddef.h>
|
|
@@ -442,7 +442,7 @@ END: Cython Metadata */
|
|
|
442
442
|
#define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
|
|
443
443
|
#endif
|
|
444
444
|
#ifndef CYTHON_NCP_UNUSED
|
|
445
|
-
# if CYTHON_COMPILING_IN_CPYTHON
|
|
445
|
+
# if CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
|
|
446
446
|
# define CYTHON_NCP_UNUSED
|
|
447
447
|
# else
|
|
448
448
|
# define CYTHON_NCP_UNUSED CYTHON_UNUSED
|
|
@@ -887,11 +887,19 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict,
|
|
|
887
887
|
#define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
|
|
888
888
|
#define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
|
|
889
889
|
#endif
|
|
890
|
-
#if
|
|
890
|
+
#if CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
|
|
891
891
|
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
|
|
892
892
|
#define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
|
|
893
|
+
#elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
|
|
894
|
+
#define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
|
|
893
895
|
#else
|
|
894
|
-
#define __Pyx_PyList_GetItemRef(o, i)
|
|
896
|
+
#define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i)
|
|
897
|
+
#endif
|
|
898
|
+
#elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
|
|
899
|
+
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
|
|
900
|
+
#define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
|
|
901
|
+
#else
|
|
902
|
+
#define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i))
|
|
895
903
|
#endif
|
|
896
904
|
#else
|
|
897
905
|
#define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i))
|
|
@@ -1299,7 +1307,9 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
|
|
|
1299
1307
|
#endif /* __GNUC__ */
|
|
1300
1308
|
/* PretendToInitialize */
|
|
1301
1309
|
#ifdef __cplusplus
|
|
1310
|
+
#if __cplusplus > 201103L
|
|
1302
1311
|
#include <type_traits>
|
|
1312
|
+
#endif
|
|
1303
1313
|
template <typename T>
|
|
1304
1314
|
static void __Pyx_pretend_to_initialize(T* ptr) {
|
|
1305
1315
|
#if __cplusplus > 201103L
|
|
@@ -2117,18 +2127,18 @@ static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
|
|
|
2117
2127
|
#endif
|
|
2118
2128
|
|
|
2119
2129
|
/* GetItemInt.proto */
|
|
2120
|
-
#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
|
|
2130
|
+
#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil)\
|
|
2121
2131
|
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
|
|
2122
2132
|
__Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
|
|
2123
2133
|
(is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
|
|
2124
2134
|
__Pyx_GetItemInt_Generic(o, to_py_func(i))))
|
|
2125
|
-
#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
|
|
2135
|
+
#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil)\
|
|
2126
2136
|
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
|
|
2127
2137
|
__Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
|
|
2128
2138
|
(PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
|
|
2129
2139
|
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
|
|
2130
2140
|
int wraparound, int boundscheck);
|
|
2131
|
-
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
|
|
2141
|
+
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil)\
|
|
2132
2142
|
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
|
|
2133
2143
|
__Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
|
|
2134
2144
|
(PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
|
|
@@ -2187,7 +2197,7 @@ static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
|
|
|
2187
2197
|
}
|
|
2188
2198
|
|
|
2189
2199
|
/* SetItemInt.proto */
|
|
2190
|
-
#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
|
|
2200
|
+
#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck, has_gil)\
|
|
2191
2201
|
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
|
|
2192
2202
|
__Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
|
|
2193
2203
|
(is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
|
|
@@ -2196,6 +2206,15 @@ static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
|
|
|
2196
2206
|
static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
|
|
2197
2207
|
int is_list, int wraparound, int boundscheck);
|
|
2198
2208
|
|
|
2209
|
+
/* LimitedApiGetTypeDict.proto */
|
|
2210
|
+
#if CYTHON_COMPILING_IN_LIMITED_API
|
|
2211
|
+
static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp);
|
|
2212
|
+
#endif
|
|
2213
|
+
|
|
2214
|
+
/* SetItemOnTypeDict.proto */
|
|
2215
|
+
static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v);
|
|
2216
|
+
#define __Pyx_SetItemOnTypeDict(tp, k, v) __Pyx__SetItemOnTypeDict((PyTypeObject*)tp, k, v)
|
|
2217
|
+
|
|
2199
2218
|
/* FixUpExtensionType.proto */
|
|
2200
2219
|
static CYTHON_INLINE int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type);
|
|
2201
2220
|
|
|
@@ -2206,7 +2225,11 @@ static PyObject *__Pyx_FetchSharedCythonABIModule(void);
|
|
|
2206
2225
|
static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value, int is_safe_type);
|
|
2207
2226
|
|
|
2208
2227
|
/* FetchCommonType.proto */
|
|
2209
|
-
static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases);
|
|
2228
|
+
static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases);
|
|
2229
|
+
|
|
2230
|
+
/* CommonTypesMetaclass.proto */
|
|
2231
|
+
static int __pyx_CommonTypesMetaclass_init(PyObject *module);
|
|
2232
|
+
#define __Pyx_CommonTypesMetaclass_USED
|
|
2210
2233
|
|
|
2211
2234
|
/* RaiseException.proto */
|
|
2212
2235
|
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
|
|
@@ -2337,6 +2360,7 @@ static PyObject *__Pyx_Coroutine_get_is_running_getter(PyObject *gen, void *clos
|
|
|
2337
2360
|
#if __PYX_HAS_PY_AM_SEND == 2
|
|
2338
2361
|
static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethodsStruct *static_amsend_methods, __Pyx_pyiter_sendfunc am_send);
|
|
2339
2362
|
#endif
|
|
2363
|
+
static PyObject *__Pyx_Coroutine_fail_reduce_ex(PyObject *self, PyObject *arg);
|
|
2340
2364
|
|
|
2341
2365
|
/* Generator.proto */
|
|
2342
2366
|
#define __Pyx_Generator_USED
|
|
@@ -3179,6 +3203,7 @@ static const char __pyx_k_qualname[] = "__qualname__";
|
|
|
3179
3203
|
static const char __pyx_k_rectArea[] = "rectArea";
|
|
3180
3204
|
static const char __pyx_k_sectRect[] = "sectRect";
|
|
3181
3205
|
static const char __pyx_k_segments[] = "segments";
|
|
3206
|
+
static const char __pyx_k_set_name[] = "__set_name__";
|
|
3182
3207
|
static const char __pyx_k_TypeError[] = "TypeError";
|
|
3183
3208
|
static const char __pyx_k_c11_range[] = "c11_range";
|
|
3184
3209
|
static const char __pyx_k_c12_range[] = "c12_range";
|
|
@@ -3471,7 +3496,7 @@ typedef struct {
|
|
|
3471
3496
|
PyObject *__pyx_slice[2];
|
|
3472
3497
|
PyObject *__pyx_tuple[4];
|
|
3473
3498
|
PyObject *__pyx_codeobj_tab[54];
|
|
3474
|
-
PyObject *__pyx_string_tab[
|
|
3499
|
+
PyObject *__pyx_string_tab[337];
|
|
3475
3500
|
PyObject *__pyx_float_0_0;
|
|
3476
3501
|
PyObject *__pyx_float_0_5;
|
|
3477
3502
|
PyObject *__pyx_float_1_0;
|
|
@@ -3494,6 +3519,9 @@ typedef struct {
|
|
|
3494
3519
|
PyObject *__pyx_int_6;
|
|
3495
3520
|
PyObject *__pyx_int_neg_1;
|
|
3496
3521
|
/* #### Code section: module_state_contents ### */
|
|
3522
|
+
/* CommonTypesMetaclass.module_state_decls */
|
|
3523
|
+
PyTypeObject *__pyx_CommonTypesMetaclassType;
|
|
3524
|
+
|
|
3497
3525
|
/* IterNextPlain.module_state_decls */
|
|
3498
3526
|
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
|
|
3499
3527
|
PyObject *__Pyx_GetBuiltinNext_LimitedAPI_cache;
|
|
@@ -3837,77 +3865,78 @@ static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_stati
|
|
|
3837
3865
|
#define __pyx_n_u_segmentrepr_locals_genexpr __pyx_string_tab[262]
|
|
3838
3866
|
#define __pyx_n_u_segments __pyx_string_tab[263]
|
|
3839
3867
|
#define __pyx_n_u_send __pyx_string_tab[264]
|
|
3840
|
-
#define
|
|
3841
|
-
#define
|
|
3842
|
-
#define
|
|
3843
|
-
#define
|
|
3844
|
-
#define
|
|
3845
|
-
#define
|
|
3846
|
-
#define
|
|
3847
|
-
#define
|
|
3848
|
-
#define
|
|
3849
|
-
#define
|
|
3850
|
-
#define
|
|
3851
|
-
#define
|
|
3852
|
-
#define
|
|
3853
|
-
#define
|
|
3854
|
-
#define
|
|
3855
|
-
#define
|
|
3856
|
-
#define
|
|
3857
|
-
#define
|
|
3858
|
-
#define
|
|
3859
|
-
#define
|
|
3860
|
-
#define
|
|
3861
|
-
#define
|
|
3862
|
-
#define
|
|
3863
|
-
#define
|
|
3864
|
-
#define
|
|
3865
|
-
#define
|
|
3866
|
-
#define
|
|
3867
|
-
#define
|
|
3868
|
-
#define
|
|
3869
|
-
#define
|
|
3870
|
-
#define
|
|
3871
|
-
#define
|
|
3872
|
-
#define
|
|
3873
|
-
#define
|
|
3874
|
-
#define
|
|
3875
|
-
#define
|
|
3876
|
-
#define
|
|
3877
|
-
#define
|
|
3878
|
-
#define
|
|
3879
|
-
#define
|
|
3880
|
-
#define
|
|
3881
|
-
#define
|
|
3882
|
-
#define
|
|
3883
|
-
#define
|
|
3884
|
-
#define
|
|
3885
|
-
#define
|
|
3886
|
-
#define
|
|
3887
|
-
#define
|
|
3888
|
-
#define
|
|
3889
|
-
#define
|
|
3890
|
-
#define
|
|
3891
|
-
#define
|
|
3892
|
-
#define
|
|
3893
|
-
#define
|
|
3894
|
-
#define
|
|
3895
|
-
#define
|
|
3896
|
-
#define
|
|
3897
|
-
#define
|
|
3898
|
-
#define
|
|
3899
|
-
#define
|
|
3900
|
-
#define
|
|
3901
|
-
#define
|
|
3902
|
-
#define
|
|
3903
|
-
#define
|
|
3904
|
-
#define
|
|
3905
|
-
#define
|
|
3906
|
-
#define
|
|
3907
|
-
#define
|
|
3908
|
-
#define
|
|
3909
|
-
#define
|
|
3910
|
-
#define
|
|
3868
|
+
#define __pyx_n_u_set_name __pyx_string_tab[265]
|
|
3869
|
+
#define __pyx_n_u_slope12 __pyx_string_tab[266]
|
|
3870
|
+
#define __pyx_n_u_slope34 __pyx_string_tab[267]
|
|
3871
|
+
#define __pyx_n_u_solutions __pyx_string_tab[268]
|
|
3872
|
+
#define __pyx_n_u_solveCubic __pyx_string_tab[269]
|
|
3873
|
+
#define __pyx_kp_u_solveCubic_line_848 __pyx_string_tab[270]
|
|
3874
|
+
#define __pyx_n_u_solveQuadratic __pyx_string_tab[271]
|
|
3875
|
+
#define __pyx_n_u_spec __pyx_string_tab[272]
|
|
3876
|
+
#define __pyx_n_u_split __pyx_string_tab[273]
|
|
3877
|
+
#define __pyx_n_u_splitCubic __pyx_string_tab[274]
|
|
3878
|
+
#define __pyx_n_u_splitCubicAtT __pyx_string_tab[275]
|
|
3879
|
+
#define __pyx_n_u_splitCubicAtTC __pyx_string_tab[276]
|
|
3880
|
+
#define __pyx_n_u_splitCubicAtTC_2 __pyx_string_tab[277]
|
|
3881
|
+
#define __pyx_n_u_splitCubicAtT_2 __pyx_string_tab[278]
|
|
3882
|
+
#define __pyx_kp_u_splitCubicAtT_line_613 __pyx_string_tab[279]
|
|
3883
|
+
#define __pyx_n_u_splitCubicIntoTwoAtTC __pyx_string_tab[280]
|
|
3884
|
+
#define __pyx_kp_u_splitCubic_line_552 __pyx_string_tab[281]
|
|
3885
|
+
#define __pyx_n_u_splitCubic_locals_genexpr __pyx_string_tab[282]
|
|
3886
|
+
#define __pyx_n_u_splitLine __pyx_string_tab[283]
|
|
3887
|
+
#define __pyx_kp_u_splitLine_line_450 __pyx_string_tab[284]
|
|
3888
|
+
#define __pyx_n_u_splitQuadratic __pyx_string_tab[285]
|
|
3889
|
+
#define __pyx_n_u_splitQuadraticAtT __pyx_string_tab[286]
|
|
3890
|
+
#define __pyx_n_u_splitQuadraticAtT_2 __pyx_string_tab[287]
|
|
3891
|
+
#define __pyx_kp_u_splitQuadraticAtT_line_589 __pyx_string_tab[288]
|
|
3892
|
+
#define __pyx_kp_u_splitQuadratic_line_507 __pyx_string_tab[289]
|
|
3893
|
+
#define __pyx_n_u_splitQuadratic_locals_genexpr __pyx_string_tab[290]
|
|
3894
|
+
#define __pyx_n_u_split_cubic_into_two __pyx_string_tab[291]
|
|
3895
|
+
#define __pyx_n_u_split_segment_at_t __pyx_string_tab[292]
|
|
3896
|
+
#define __pyx_n_u_sqrt __pyx_string_tab[293]
|
|
3897
|
+
#define __pyx_n_u_start __pyx_string_tab[294]
|
|
3898
|
+
#define __pyx_n_u_swapped __pyx_string_tab[295]
|
|
3899
|
+
#define __pyx_n_u_sx __pyx_string_tab[296]
|
|
3900
|
+
#define __pyx_n_u_sy __pyx_string_tab[297]
|
|
3901
|
+
#define __pyx_n_u_sys __pyx_string_tab[298]
|
|
3902
|
+
#define __pyx_n_u_t __pyx_string_tab[299]
|
|
3903
|
+
#define __pyx_n_u_t1 __pyx_string_tab[300]
|
|
3904
|
+
#define __pyx_n_u_t1_2 __pyx_string_tab[301]
|
|
3905
|
+
#define __pyx_n_u_t1_3 __pyx_string_tab[302]
|
|
3906
|
+
#define __pyx_n_u_t2 __pyx_string_tab[303]
|
|
3907
|
+
#define __pyx_n_u_test __pyx_string_tab[304]
|
|
3908
|
+
#define __pyx_n_u_testmod __pyx_string_tab[305]
|
|
3909
|
+
#define __pyx_n_u_theta __pyx_string_tab[306]
|
|
3910
|
+
#define __pyx_n_u_throw __pyx_string_tab[307]
|
|
3911
|
+
#define __pyx_n_u_tolerance __pyx_string_tab[308]
|
|
3912
|
+
#define __pyx_n_u_transformPoints __pyx_string_tab[309]
|
|
3913
|
+
#define __pyx_n_u_translate __pyx_string_tab[310]
|
|
3914
|
+
#define __pyx_n_u_ts __pyx_string_tab[311]
|
|
3915
|
+
#define __pyx_n_u_two __pyx_string_tab[312]
|
|
3916
|
+
#define __pyx_n_u_unique_key __pyx_string_tab[313]
|
|
3917
|
+
#define __pyx_n_u_unique_values __pyx_string_tab[314]
|
|
3918
|
+
#define __pyx_n_u_v0 __pyx_string_tab[315]
|
|
3919
|
+
#define __pyx_n_u_v1 __pyx_string_tab[316]
|
|
3920
|
+
#define __pyx_n_u_v2 __pyx_string_tab[317]
|
|
3921
|
+
#define __pyx_n_u_v3 __pyx_string_tab[318]
|
|
3922
|
+
#define __pyx_n_u_v4 __pyx_string_tab[319]
|
|
3923
|
+
#define __pyx_n_u_value __pyx_string_tab[320]
|
|
3924
|
+
#define __pyx_n_u_where __pyx_string_tab[321]
|
|
3925
|
+
#define __pyx_n_u_x __pyx_string_tab[322]
|
|
3926
|
+
#define __pyx_n_u_x0 __pyx_string_tab[323]
|
|
3927
|
+
#define __pyx_n_u_x1 __pyx_string_tab[324]
|
|
3928
|
+
#define __pyx_n_u_x2 __pyx_string_tab[325]
|
|
3929
|
+
#define __pyx_n_u_x3 __pyx_string_tab[326]
|
|
3930
|
+
#define __pyx_n_u_x4 __pyx_string_tab[327]
|
|
3931
|
+
#define __pyx_n_u_xDiff __pyx_string_tab[328]
|
|
3932
|
+
#define __pyx_n_u_xRoots __pyx_string_tab[329]
|
|
3933
|
+
#define __pyx_n_u_y __pyx_string_tab[330]
|
|
3934
|
+
#define __pyx_n_u_y1 __pyx_string_tab[331]
|
|
3935
|
+
#define __pyx_n_u_y2 __pyx_string_tab[332]
|
|
3936
|
+
#define __pyx_n_u_y3 __pyx_string_tab[333]
|
|
3937
|
+
#define __pyx_n_u_y4 __pyx_string_tab[334]
|
|
3938
|
+
#define __pyx_n_u_yDiff __pyx_string_tab[335]
|
|
3939
|
+
#define __pyx_n_u_yRoots __pyx_string_tab[336]
|
|
3911
3940
|
/* #### Code section: module_state_clear ### */
|
|
3912
3941
|
#if CYTHON_USE_MODULE_STATE
|
|
3913
3942
|
static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) {
|
|
@@ -3949,7 +3978,7 @@ static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) {
|
|
|
3949
3978
|
for (int i=0; i<2; ++i) { Py_CLEAR(clear_module_state->__pyx_slice[i]); }
|
|
3950
3979
|
for (int i=0; i<4; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); }
|
|
3951
3980
|
for (int i=0; i<54; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
|
|
3952
|
-
for (int i=0; i<
|
|
3981
|
+
for (int i=0; i<337; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
|
|
3953
3982
|
Py_CLEAR(clear_module_state->__pyx_float_0_0);
|
|
3954
3983
|
Py_CLEAR(clear_module_state->__pyx_float_0_5);
|
|
3955
3984
|
Py_CLEAR(clear_module_state->__pyx_float_1_0);
|
|
@@ -4012,7 +4041,7 @@ static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void
|
|
|
4012
4041
|
for (int i=0; i<2; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_slice[i]); }
|
|
4013
4042
|
for (int i=0; i<4; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); }
|
|
4014
4043
|
for (int i=0; i<54; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
|
|
4015
|
-
for (int i=0; i<
|
|
4044
|
+
for (int i=0; i<337; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
|
|
4016
4045
|
__Pyx_VISIT_CONST(traverse_module_state->__pyx_float_0_0);
|
|
4017
4046
|
__Pyx_VISIT_CONST(traverse_module_state->__pyx_float_0_5);
|
|
4018
4047
|
__Pyx_VISIT_CONST(traverse_module_state->__pyx_float_1_0);
|
|
@@ -4055,7 +4084,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
|
4055
4084
|
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
4056
4085
|
#endif
|
|
4057
4086
|
); /*proto*/
|
|
4058
|
-
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_calcCubicArcLength, "calcCubicArcLength(pt1, pt2, pt3, pt4, tolerance=0.005)\nCalculates the arc length for a cubic Bezier segment.\n\nWhereas :func:`approximateCubicArcLength` approximates the length, this\nfunction calculates it by \"measuring\", recursively dividing the curve\nuntil the divided segments are shorter than ``tolerance``.\n\nArgs:\n pt1,pt2,pt3,pt4: Control points of the Bezier as 2D tuples.\n tolerance: Controls the precision of the calcuation.\n\nReturns:\n Arc length value.");
|
|
4087
|
+
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_calcCubicArcLength, "calcCubicArcLength(pt1, pt2, pt3, pt4, tolerance=0.005)\n\nCalculates the arc length for a cubic Bezier segment.\n\nWhereas :func:`approximateCubicArcLength` approximates the length, this\nfunction calculates it by \"measuring\", recursively dividing the curve\nuntil the divided segments are shorter than ``tolerance``.\n\nArgs:\n pt1,pt2,pt3,pt4: Control points of the Bezier as 2D tuples.\n tolerance: Controls the precision of the calcuation.\n\nReturns:\n Arc length value.");
|
|
4059
4088
|
static PyMethodDef __pyx_mdef_9fontTools_4misc_11bezierTools_1calcCubicArcLength = {"calcCubicArcLength", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9fontTools_4misc_11bezierTools_1calcCubicArcLength, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9fontTools_4misc_11bezierTools_calcCubicArcLength};
|
|
4060
4089
|
static PyObject *__pyx_pw_9fontTools_4misc_11bezierTools_1calcCubicArcLength(PyObject *__pyx_self,
|
|
4061
4090
|
#if CYTHON_METH_FASTCALL
|
|
@@ -5010,7 +5039,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
|
5010
5039
|
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
5011
5040
|
#endif
|
|
5012
5041
|
); /*proto*/
|
|
5013
|
-
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_6calcCubicArcLengthC, "calcCubicArcLengthC(double complex pt1, double complex pt2, double complex pt3, double complex pt4, double tolerance=0.005)\nCalculates the arc length for a cubic Bezier segment.\n\nArgs:\n pt1,pt2,pt3,pt4: Control points of the Bezier as complex numbers.\n tolerance: Controls the precision of the calcuation.\n\nReturns:\n Arc length value.");
|
|
5042
|
+
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_6calcCubicArcLengthC, "calcCubicArcLengthC(double complex pt1, double complex pt2, double complex pt3, double complex pt4, double tolerance=0.005)\n\nCalculates the arc length for a cubic Bezier segment.\n\nArgs:\n pt1,pt2,pt3,pt4: Control points of the Bezier as complex numbers.\n tolerance: Controls the precision of the calcuation.\n\nReturns:\n Arc length value.");
|
|
5014
5043
|
static PyMethodDef __pyx_mdef_9fontTools_4misc_11bezierTools_7calcCubicArcLengthC = {"calcCubicArcLengthC", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9fontTools_4misc_11bezierTools_7calcCubicArcLengthC, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9fontTools_4misc_11bezierTools_6calcCubicArcLengthC};
|
|
5015
5044
|
static PyObject *__pyx_pw_9fontTools_4misc_11bezierTools_7calcCubicArcLengthC(PyObject *__pyx_self,
|
|
5016
5045
|
#if CYTHON_METH_FASTCALL
|
|
@@ -5413,7 +5442,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
|
5413
5442
|
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
5414
5443
|
#endif
|
|
5415
5444
|
); /*proto*/
|
|
5416
|
-
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_8calcQuadraticArcLength, "calcQuadraticArcLength(pt1, pt2, pt3)\nCalculates the arc length for a quadratic Bezier segment.\n\nArgs:\n pt1: Start point of the Bezier as 2D tuple.\n pt2: Handle point of the Bezier as 2D tuple.\n pt3: End point of the Bezier as 2D tuple.\n\nReturns:\n Arc length value.\n\nExample::\n\n >>> calcQuadraticArcLength((0, 0), (0, 0), (0, 0)) # empty segment\n 0.0\n >>> calcQuadraticArcLength((0, 0), (50, 0), (80, 0)) # collinear points\n 80.0\n >>> calcQuadraticArcLength((0, 0), (0, 50), (0, 80)) # collinear points vertical\n 80.0\n >>> calcQuadraticArcLength((0, 0), (50, 20), (100, 40)) # collinear points\n 107.70329614269008\n >>> calcQuadraticArcLength((0, 0), (0, 100), (100, 0))\n 154.02976155645263\n >>> calcQuadraticArcLength((0, 0), (0, 50), (100, 0))\n 120.21581243984076\n >>> calcQuadraticArcLength((0, 0), (50, -10), (80, 50))\n 102.53273816445825\n >>> calcQuadraticArcLength((0, 0), (40, 0), (-40, 0)) # collinear points, control point outside\n 66.66666666666667\n >>> calcQuadraticArcLength((0, 0), (40, 0), (0, 0)) # collinear points, looping back\n 40.0");
|
|
5445
|
+
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_8calcQuadraticArcLength, "calcQuadraticArcLength(pt1, pt2, pt3)\n\nCalculates the arc length for a quadratic Bezier segment.\n\nArgs:\n pt1: Start point of the Bezier as 2D tuple.\n pt2: Handle point of the Bezier as 2D tuple.\n pt3: End point of the Bezier as 2D tuple.\n\nReturns:\n Arc length value.\n\nExample::\n\n >>> calcQuadraticArcLength((0, 0), (0, 0), (0, 0)) # empty segment\n 0.0\n >>> calcQuadraticArcLength((0, 0), (50, 0), (80, 0)) # collinear points\n 80.0\n >>> calcQuadraticArcLength((0, 0), (0, 50), (0, 80)) # collinear points vertical\n 80.0\n >>> calcQuadraticArcLength((0, 0), (50, 20), (100, 40)) # collinear points\n 107.70329614269008\n >>> calcQuadraticArcLength((0, 0), (0, 100), (100, 0))\n 154.02976155645263\n >>> calcQuadraticArcLength((0, 0), (0, 50), (100, 0))\n 120.21581243984076\n >>> calcQuadraticArcLength((0, 0), (50, -10), (80, 50))\n 102.53273816445825\n >>> calcQuadraticArcLength((0, 0), (40, 0), (-40, 0)) # collinear points, control point outside\n 66.66666666666667\n >>> calcQuadraticArcLength((0, 0), (40, 0), (0, 0)) # collinear points, looping back\n 40.0");
|
|
5417
5446
|
static PyMethodDef __pyx_mdef_9fontTools_4misc_11bezierTools_9calcQuadraticArcLength = {"calcQuadraticArcLength", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9fontTools_4misc_11bezierTools_9calcQuadraticArcLength, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9fontTools_4misc_11bezierTools_8calcQuadraticArcLength};
|
|
5418
5447
|
static PyObject *__pyx_pw_9fontTools_4misc_11bezierTools_9calcQuadraticArcLength(PyObject *__pyx_self,
|
|
5419
5448
|
#if CYTHON_METH_FASTCALL
|
|
@@ -5617,7 +5646,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
|
5617
5646
|
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
5618
5647
|
#endif
|
|
5619
5648
|
); /*proto*/
|
|
5620
|
-
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_10calcQuadraticArcLengthC, "calcQuadraticArcLengthC(double complex pt1, double complex pt2, double complex pt3)\nCalculates the arc length for a quadratic Bezier segment.\n\nArgs:\n pt1: Start point of the Bezier as a complex number.\n pt2: Handle point of the Bezier as a complex number.\n pt3: End point of the Bezier as a complex number.\n\nReturns:\n Arc length value.");
|
|
5649
|
+
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_10calcQuadraticArcLengthC, "calcQuadraticArcLengthC(double complex pt1, double complex pt2, double complex pt3)\n\nCalculates the arc length for a quadratic Bezier segment.\n\nArgs:\n pt1: Start point of the Bezier as a complex number.\n pt2: Handle point of the Bezier as a complex number.\n pt3: End point of the Bezier as a complex number.\n\nReturns:\n Arc length value.");
|
|
5621
5650
|
static PyMethodDef __pyx_mdef_9fontTools_4misc_11bezierTools_11calcQuadraticArcLengthC = {"calcQuadraticArcLengthC", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9fontTools_4misc_11bezierTools_11calcQuadraticArcLengthC, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9fontTools_4misc_11bezierTools_10calcQuadraticArcLengthC};
|
|
5622
5651
|
static PyObject *__pyx_pw_9fontTools_4misc_11bezierTools_11calcQuadraticArcLengthC(PyObject *__pyx_self,
|
|
5623
5652
|
#if CYTHON_METH_FASTCALL
|
|
@@ -6016,7 +6045,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
|
6016
6045
|
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
6017
6046
|
#endif
|
|
6018
6047
|
); /*proto*/
|
|
6019
|
-
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_12approximateQuadraticArcLength, "approximateQuadraticArcLength(pt1, pt2, pt3)\nCalculates the arc length for a quadratic Bezier segment.\n\nUses Gauss-Legendre quadrature for a branch-free approximation.\nSee :func:`calcQuadraticArcLength` for a slower but more accurate result.\n\nArgs:\n pt1: Start point of the Bezier as 2D tuple.\n pt2: Handle point of the Bezier as 2D tuple.\n pt3: End point of the Bezier as 2D tuple.\n\nReturns:\n Approximate arc length value.");
|
|
6048
|
+
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_12approximateQuadraticArcLength, "approximateQuadraticArcLength(pt1, pt2, pt3)\n\nCalculates the arc length for a quadratic Bezier segment.\n\nUses Gauss-Legendre quadrature for a branch-free approximation.\nSee :func:`calcQuadraticArcLength` for a slower but more accurate result.\n\nArgs:\n pt1: Start point of the Bezier as 2D tuple.\n pt2: Handle point of the Bezier as 2D tuple.\n pt3: End point of the Bezier as 2D tuple.\n\nReturns:\n Approximate arc length value.");
|
|
6020
6049
|
static PyMethodDef __pyx_mdef_9fontTools_4misc_11bezierTools_13approximateQuadraticArcLength = {"approximateQuadraticArcLength", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9fontTools_4misc_11bezierTools_13approximateQuadraticArcLength, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9fontTools_4misc_11bezierTools_12approximateQuadraticArcLength};
|
|
6021
6050
|
static PyObject *__pyx_pw_9fontTools_4misc_11bezierTools_13approximateQuadraticArcLength(PyObject *__pyx_self,
|
|
6022
6051
|
#if CYTHON_METH_FASTCALL
|
|
@@ -6220,7 +6249,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
|
6220
6249
|
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
6221
6250
|
#endif
|
|
6222
6251
|
); /*proto*/
|
|
6223
|
-
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_14approximateQuadraticArcLengthC, "approximateQuadraticArcLengthC(double complex pt1, double complex pt2, double complex pt3)\nCalculates the arc length for a quadratic Bezier segment.\n\nUses Gauss-Legendre quadrature for a branch-free approximation.\nSee :func:`calcQuadraticArcLength` for a slower but more accurate result.\n\nArgs:\n pt1: Start point of the Bezier as a complex number.\n pt2: Handle point of the Bezier as a complex number.\n pt3: End point of the Bezier as a complex number.\n\nReturns:\n Approximate arc length value.");
|
|
6252
|
+
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_14approximateQuadraticArcLengthC, "approximateQuadraticArcLengthC(double complex pt1, double complex pt2, double complex pt3)\n\nCalculates the arc length for a quadratic Bezier segment.\n\nUses Gauss-Legendre quadrature for a branch-free approximation.\nSee :func:`calcQuadraticArcLength` for a slower but more accurate result.\n\nArgs:\n pt1: Start point of the Bezier as a complex number.\n pt2: Handle point of the Bezier as a complex number.\n pt3: End point of the Bezier as a complex number.\n\nReturns:\n Approximate arc length value.");
|
|
6224
6253
|
static PyMethodDef __pyx_mdef_9fontTools_4misc_11bezierTools_15approximateQuadraticArcLengthC = {"approximateQuadraticArcLengthC", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9fontTools_4misc_11bezierTools_15approximateQuadraticArcLengthC, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9fontTools_4misc_11bezierTools_14approximateQuadraticArcLengthC};
|
|
6225
6254
|
static PyObject *__pyx_pw_9fontTools_4misc_11bezierTools_15approximateQuadraticArcLengthC(PyObject *__pyx_self,
|
|
6226
6255
|
#if CYTHON_METH_FASTCALL
|
|
@@ -6402,7 +6431,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
|
6402
6431
|
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
6403
6432
|
#endif
|
|
6404
6433
|
); /*proto*/
|
|
6405
|
-
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_16calcQuadraticBounds, "calcQuadraticBounds(pt1, pt2, pt3)\nCalculates the bounding rectangle for a quadratic Bezier segment.\n\nArgs:\n pt1: Start point of the Bezier as a 2D tuple.\n pt2: Handle point of the Bezier as a 2D tuple.\n pt3: End point of the Bezier as a 2D tuple.\n\nReturns:\n A four-item tuple representing the bounding rectangle ``(xMin, yMin, xMax, yMax)``.\n\nExample::\n\n >>> calcQuadraticBounds((0, 0), (50, 100), (100, 0))\n (0, 0, 100, 50.0)\n >>> calcQuadraticBounds((0, 0), (100, 0), (100, 100))\n (0.0, 0.0, 100, 100)");
|
|
6434
|
+
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_16calcQuadraticBounds, "calcQuadraticBounds(pt1, pt2, pt3)\n\nCalculates the bounding rectangle for a quadratic Bezier segment.\n\nArgs:\n pt1: Start point of the Bezier as a 2D tuple.\n pt2: Handle point of the Bezier as a 2D tuple.\n pt3: End point of the Bezier as a 2D tuple.\n\nReturns:\n A four-item tuple representing the bounding rectangle ``(xMin, yMin, xMax, yMax)``.\n\nExample::\n\n >>> calcQuadraticBounds((0, 0), (50, 100), (100, 0))\n (0, 0, 100, 50.0)\n >>> calcQuadraticBounds((0, 0), (100, 0), (100, 100))\n (0.0, 0.0, 100, 100)");
|
|
6406
6435
|
static PyMethodDef __pyx_mdef_9fontTools_4misc_11bezierTools_17calcQuadraticBounds = {"calcQuadraticBounds", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9fontTools_4misc_11bezierTools_17calcQuadraticBounds, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9fontTools_4misc_11bezierTools_16calcQuadraticBounds};
|
|
6407
6436
|
static PyObject *__pyx_pw_9fontTools_4misc_11bezierTools_17calcQuadraticBounds(PyObject *__pyx_self,
|
|
6408
6437
|
#if CYTHON_METH_FASTCALL
|
|
@@ -7123,7 +7152,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
|
7123
7152
|
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
7124
7153
|
#endif
|
|
7125
7154
|
); /*proto*/
|
|
7126
|
-
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_18approximateCubicArcLength, "approximateCubicArcLength(pt1, pt2, pt3, pt4)\nApproximates the arc length for a cubic Bezier segment.\n\nUses Gauss-Lobatto quadrature with n=5 points to approximate arc length.\nSee :func:`calcCubicArcLength` for a slower but more accurate result.\n\nArgs:\n pt1,pt2,pt3,pt4: Control points of the Bezier as 2D tuples.\n\nReturns:\n Arc length value.\n\nExample::\n\n >>> approximateCubicArcLength((0, 0), (25, 100), (75, 100), (100, 0))\n 190.04332968932817\n >>> approximateCubicArcLength((0, 0), (50, 0), (100, 50), (100, 100))\n 154.8852074945903\n >>> approximateCubicArcLength((0, 0), (50, 0), (100, 0), (150, 0)) # line; exact result should be 150.\n 149.99999999999991\n >>> approximateCubicArcLength((0, 0), (50, 0), (100, 0), (-50, 0)) # cusp; exact result should be 150.\n 136.9267662156362\n >>> approximateCubicArcLength((0, 0), (50, 0), (100, -50), (-50, 0)) # cusp\n 154.80848416537057");
|
|
7155
|
+
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_18approximateCubicArcLength, "approximateCubicArcLength(pt1, pt2, pt3, pt4)\n\nApproximates the arc length for a cubic Bezier segment.\n\nUses Gauss-Lobatto quadrature with n=5 points to approximate arc length.\nSee :func:`calcCubicArcLength` for a slower but more accurate result.\n\nArgs:\n pt1,pt2,pt3,pt4: Control points of the Bezier as 2D tuples.\n\nReturns:\n Arc length value.\n\nExample::\n\n >>> approximateCubicArcLength((0, 0), (25, 100), (75, 100), (100, 0))\n 190.04332968932817\n >>> approximateCubicArcLength((0, 0), (50, 0), (100, 50), (100, 100))\n 154.8852074945903\n >>> approximateCubicArcLength((0, 0), (50, 0), (100, 0), (150, 0)) # line; exact result should be 150.\n 149.99999999999991\n >>> approximateCubicArcLength((0, 0), (50, 0), (100, 0), (-50, 0)) # cusp; exact result should be 150.\n 136.9267662156362\n >>> approximateCubicArcLength((0, 0), (50, 0), (100, -50), (-50, 0)) # cusp\n 154.80848416537057");
|
|
7127
7156
|
static PyMethodDef __pyx_mdef_9fontTools_4misc_11bezierTools_19approximateCubicArcLength = {"approximateCubicArcLength", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9fontTools_4misc_11bezierTools_19approximateCubicArcLength, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9fontTools_4misc_11bezierTools_18approximateCubicArcLength};
|
|
7128
7157
|
static PyObject *__pyx_pw_9fontTools_4misc_11bezierTools_19approximateCubicArcLength(PyObject *__pyx_self,
|
|
7129
7158
|
#if CYTHON_METH_FASTCALL
|
|
@@ -7351,7 +7380,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
|
7351
7380
|
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
7352
7381
|
#endif
|
|
7353
7382
|
); /*proto*/
|
|
7354
|
-
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_20approximateCubicArcLengthC, "approximateCubicArcLengthC(double complex pt1, double complex pt2, double complex pt3, double complex pt4)\nApproximates the arc length for a cubic Bezier segment.\n\nArgs:\n pt1,pt2,pt3,pt4: Control points of the Bezier as complex numbers.\n\nReturns:\n Arc length value.");
|
|
7383
|
+
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_20approximateCubicArcLengthC, "approximateCubicArcLengthC(double complex pt1, double complex pt2, double complex pt3, double complex pt4)\n\nApproximates the arc length for a cubic Bezier segment.\n\nArgs:\n pt1,pt2,pt3,pt4: Control points of the Bezier as complex numbers.\n\nReturns:\n Arc length value.");
|
|
7355
7384
|
static PyMethodDef __pyx_mdef_9fontTools_4misc_11bezierTools_21approximateCubicArcLengthC = {"approximateCubicArcLengthC", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9fontTools_4misc_11bezierTools_21approximateCubicArcLengthC, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9fontTools_4misc_11bezierTools_20approximateCubicArcLengthC};
|
|
7356
7385
|
static PyObject *__pyx_pw_9fontTools_4misc_11bezierTools_21approximateCubicArcLengthC(PyObject *__pyx_self,
|
|
7357
7386
|
#if CYTHON_METH_FASTCALL
|
|
@@ -7561,7 +7590,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
|
7561
7590
|
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
7562
7591
|
#endif
|
|
7563
7592
|
); /*proto*/
|
|
7564
|
-
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_22calcCubicBounds, "calcCubicBounds(pt1, pt2, pt3, pt4)\nCalculates the bounding rectangle for a quadratic Bezier segment.\n\nArgs:\n pt1,pt2,pt3,pt4: Control points of the Bezier as 2D tuples.\n\nReturns:\n A four-item tuple representing the bounding rectangle ``(xMin, yMin, xMax, yMax)``.\n\nExample::\n\n >>> calcCubicBounds((0, 0), (25, 100), (75, 100), (100, 0))\n (0, 0, 100, 75.0)\n >>> calcCubicBounds((0, 0), (50, 0), (100, 50), (100, 100))\n (0.0, 0.0, 100, 100)\n >>> print(\"%f %f %f %f\" % calcCubicBounds((50, 0), (0, 100), (100, 100), (50, 0)))\n 35.566243 0.000000 64.433757 75.000000");
|
|
7593
|
+
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_22calcCubicBounds, "calcCubicBounds(pt1, pt2, pt3, pt4)\n\nCalculates the bounding rectangle for a quadratic Bezier segment.\n\nArgs:\n pt1,pt2,pt3,pt4: Control points of the Bezier as 2D tuples.\n\nReturns:\n A four-item tuple representing the bounding rectangle ``(xMin, yMin, xMax, yMax)``.\n\nExample::\n\n >>> calcCubicBounds((0, 0), (25, 100), (75, 100), (100, 0))\n (0, 0, 100, 75.0)\n >>> calcCubicBounds((0, 0), (50, 0), (100, 50), (100, 100))\n (0.0, 0.0, 100, 100)\n >>> print(\"%f %f %f %f\" % calcCubicBounds((50, 0), (0, 100), (100, 100), (50, 0)))\n 35.566243 0.000000 64.433757 75.000000");
|
|
7565
7594
|
static PyMethodDef __pyx_mdef_9fontTools_4misc_11bezierTools_23calcCubicBounds = {"calcCubicBounds", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9fontTools_4misc_11bezierTools_23calcCubicBounds, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9fontTools_4misc_11bezierTools_22calcCubicBounds};
|
|
7566
7595
|
static PyObject *__pyx_pw_9fontTools_4misc_11bezierTools_23calcCubicBounds(PyObject *__pyx_self,
|
|
7567
7596
|
#if CYTHON_METH_FASTCALL
|
|
@@ -8555,7 +8584,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
|
8555
8584
|
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
8556
8585
|
#endif
|
|
8557
8586
|
); /*proto*/
|
|
8558
|
-
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_24splitLine, "splitLine(pt1, pt2, where, isHorizontal)\nSplit a line at a given coordinate.\n\nArgs:\n pt1: Start point of line as 2D tuple.\n pt2: End point of line as 2D tuple.\n where: Position at which to split the line.\n isHorizontal: Direction of the ray splitting the line. If true,\n ``where`` is interpreted as a Y coordinate; if false, then\n ``where`` is interpreted as an X coordinate.\n\nReturns:\n A list of two line segments (each line segment being two 2D tuples)\n if the line was successfully split, or a list containing the original\n line.\n\nExample::\n\n >>> printSegments(splitLine((0, 0), (100, 100), 50, True))\n ((0, 0), (50, 50))\n ((50, 50), (100, 100))\n >>> printSegments(splitLine((0, 0), (100, 100), 100, True))\n ((0, 0), (100, 100))\n >>> printSegments(splitLine((0, 0), (100, 100), 0, True))\n ((0, 0), (0, 0))\n ((0, 0), (100, 100))\n >>> printSegments(splitLine((0, 0), (100, 100), 0, False))\n ((0, 0), (0, 0))\n ((0, 0), (100, 100))\n >>> printSegments(splitLine((100, 0), (0, 0), 50, False))\n ((100, 0), (50, 0))\n ((50, 0), (0, 0))\n >>> printSegments(splitLine((0, 100), (0, 0), 50, True))\n ((0, 100), (0, 50))\n ((0, 50), (0, 0))");
|
|
8587
|
+
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_24splitLine, "splitLine(pt1, pt2, where, isHorizontal)\n\nSplit a line at a given coordinate.\n\nArgs:\n pt1: Start point of line as 2D tuple.\n pt2: End point of line as 2D tuple.\n where: Position at which to split the line.\n isHorizontal: Direction of the ray splitting the line. If true,\n ``where`` is interpreted as a Y coordinate; if false, then\n ``where`` is interpreted as an X coordinate.\n\nReturns:\n A list of two line segments (each line segment being two 2D tuples)\n if the line was successfully split, or a list containing the original\n line.\n\nExample::\n\n >>> printSegments(splitLine((0, 0), (100, 100), 50, True))\n ((0, 0), (50, 50))\n ((50, 50), (100, 100))\n >>> printSegments(splitLine((0, 0), (100, 100), 100, True))\n ((0, 0), (100, 100))\n >>> printSegments(splitLine((0, 0), (100, 100), 0, True))\n ((0, 0), (0, 0))\n ((0, 0), (100, 100))\n >>> printSegments(splitLine((0, 0), (100, 100), 0, False))\n ((0, 0), (0, 0))\n ((0, 0), (100, 100))\n >>> printSegments(splitLine((100, 0), (0, 0), 50, False))\n ((100, 0), (50, 0))\n ((50, 0), (0, 0))\n >>> printSegments(splitLine((0, 100), (0, 0), 50, True))\n ((0, 100), (0, 50))\n ((0, 50), (0, 0))");
|
|
8559
8588
|
static PyMethodDef __pyx_mdef_9fontTools_4misc_11bezierTools_25splitLine = {"splitLine", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9fontTools_4misc_11bezierTools_25splitLine, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9fontTools_4misc_11bezierTools_24splitLine};
|
|
8560
8589
|
static PyObject *__pyx_pw_9fontTools_4misc_11bezierTools_25splitLine(PyObject *__pyx_self,
|
|
8561
8590
|
#if CYTHON_METH_FASTCALL
|
|
@@ -9101,7 +9130,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
|
9101
9130
|
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
9102
9131
|
#endif
|
|
9103
9132
|
); /*proto*/
|
|
9104
|
-
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_26splitQuadratic, "splitQuadratic(pt1, pt2, pt3, where, isHorizontal)\nSplit a quadratic Bezier curve at a given coordinate.\n\nArgs:\n pt1,pt2,pt3: Control points of the Bezier as 2D tuples.\n where: Position at which to split the curve.\n isHorizontal: Direction of the ray splitting the curve. If true,\n ``where`` is interpreted as a Y coordinate; if false, then\n ``where`` is interpreted as an X coordinate.\n\nReturns:\n A list of two curve segments (each curve segment being three 2D tuples)\n if the curve was successfully split, or a list containing the original\n curve.\n\nExample::\n\n >>> printSegments(splitQuadratic((0, 0), (50, 100), (100, 0), 150, False))\n ((0, 0), (50, 100), (100, 0))\n >>> printSegments(splitQuadratic((0, 0), (50, 100), (100, 0), 50, False))\n ((0, 0), (25, 50), (50, 50))\n ((50, 50), (75, 50), (100, 0))\n >>> printSegments(splitQuadratic((0, 0), (50, 100), (100, 0), 25, False))\n ((0, 0), (12.5, 25), (25, 37.5))\n ((25, 37.5), (62.5, 75), (100, 0))\n >>> printSegments(splitQuadratic((0, 0), (50, 100), (100, 0), 25, True))\n ((0, 0), (7.32233, 14.6447), (14.6447, 25))\n ((14.6447, 25), (50, 75), (85.3553, 25))\n ((85.3553, 25), (92.6777, 14.6447), (100, -7.10543e-15))\n >>> # XXX I'm not at all sure if the following behavior is desirable:\n >>> printSegments(splitQuadratic((0, 0), (50, 100), (100, 0), 50, True))\n ((0, 0), (25, 50), (50, 50))\n ((50, 50), (50, 50), (50, 50))\n ((50, 50), (75, 50), (100, 0))");
|
|
9133
|
+
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_26splitQuadratic, "splitQuadratic(pt1, pt2, pt3, where, isHorizontal)\n\nSplit a quadratic Bezier curve at a given coordinate.\n\nArgs:\n pt1,pt2,pt3: Control points of the Bezier as 2D tuples.\n where: Position at which to split the curve.\n isHorizontal: Direction of the ray splitting the curve. If true,\n ``where`` is interpreted as a Y coordinate; if false, then\n ``where`` is interpreted as an X coordinate.\n\nReturns:\n A list of two curve segments (each curve segment being three 2D tuples)\n if the curve was successfully split, or a list containing the original\n curve.\n\nExample::\n\n >>> printSegments(splitQuadratic((0, 0), (50, 100), (100, 0), 150, False))\n ((0, 0), (50, 100), (100, 0))\n >>> printSegments(splitQuadratic((0, 0), (50, 100), (100, 0), 50, False))\n ((0, 0), (25, 50), (50, 50))\n ((50, 50), (75, 50), (100, 0))\n >>> printSegments(splitQuadratic((0, 0), (50, 100), (100, 0), 25, False))\n ((0, 0), (12.5, 25), (25, 37.5))\n ((25, 37.5), (62.5, 75), (100, 0))\n >>> printSegments(splitQuadratic((0, 0), (50, 100), (100, 0), 25, True))\n ((0, 0), (7.32233, 14.6447), (14.6447, 25))\n ((14.6447, 25), (50, 75), (85.3553, 25))\n ((85.3553, 25), (92.6777, 14.6447), (100, -7.10543e-15))\n >>> # XXX I'm not at all sure if the following behavior is desirable:\n >>> printSegments(splitQuadratic((0, 0), (50, 100), (100, 0), 50, True))\n ((0, 0), (25, 50), (50, 50))\n ((50, 50), (50, 50), (50, 50))\n ((50, 50), (75, 50), (100, 0))");
|
|
9105
9134
|
static PyMethodDef __pyx_mdef_9fontTools_4misc_11bezierTools_27splitQuadratic = {"splitQuadratic", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9fontTools_4misc_11bezierTools_27splitQuadratic, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9fontTools_4misc_11bezierTools_26splitQuadratic};
|
|
9106
9135
|
static PyObject *__pyx_pw_9fontTools_4misc_11bezierTools_27splitQuadratic(PyObject *__pyx_self,
|
|
9107
9136
|
#if CYTHON_METH_FASTCALL
|
|
@@ -9695,7 +9724,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
|
9695
9724
|
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
9696
9725
|
#endif
|
|
9697
9726
|
); /*proto*/
|
|
9698
|
-
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_28splitCubic, "splitCubic(pt1, pt2, pt3, pt4, where, isHorizontal)\nSplit a cubic Bezier curve at a given coordinate.\n\nArgs:\n pt1,pt2,pt3,pt4: Control points of the Bezier as 2D tuples.\n where: Position at which to split the curve.\n isHorizontal: Direction of the ray splitting the curve. If true,\n ``where`` is interpreted as a Y coordinate; if false, then\n ``where`` is interpreted as an X coordinate.\n\nReturns:\n A list of two curve segments (each curve segment being four 2D tuples)\n if the curve was successfully split, or a list containing the original\n curve.\n\nExample::\n\n >>> printSegments(splitCubic((0, 0), (25, 100), (75, 100), (100, 0), 150, False))\n ((0, 0), (25, 100), (75, 100), (100, 0))\n >>> printSegments(splitCubic((0, 0), (25, 100), (75, 100), (100, 0), 50, False))\n ((0, 0), (12.5, 50), (31.25, 75), (50, 75))\n ((50, 75), (68.75, 75), (87.5, 50), (100, 0))\n >>> printSegments(splitCubic((0, 0), (25, 100), (75, 100), (100, 0), 25, True))\n ((0, 0), (2.29379, 9.17517), (4.79804, 17.5085), (7.47414, 25))\n ((7.47414, 25), (31.2886, 91.6667), (68.7114, 91.6667), (92.5259, 25))\n ((92.5259, 25), (95.202, 17.5085), (97.7062, 9.17517), (100, 1.77636e-15))");
|
|
9727
|
+
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_28splitCubic, "splitCubic(pt1, pt2, pt3, pt4, where, isHorizontal)\n\nSplit a cubic Bezier curve at a given coordinate.\n\nArgs:\n pt1,pt2,pt3,pt4: Control points of the Bezier as 2D tuples.\n where: Position at which to split the curve.\n isHorizontal: Direction of the ray splitting the curve. If true,\n ``where`` is interpreted as a Y coordinate; if false, then\n ``where`` is interpreted as an X coordinate.\n\nReturns:\n A list of two curve segments (each curve segment being four 2D tuples)\n if the curve was successfully split, or a list containing the original\n curve.\n\nExample::\n\n >>> printSegments(splitCubic((0, 0), (25, 100), (75, 100), (100, 0), 150, False))\n ((0, 0), (25, 100), (75, 100), (100, 0))\n >>> printSegments(splitCubic((0, 0), (25, 100), (75, 100), (100, 0), 50, False))\n ((0, 0), (12.5, 50), (31.25, 75), (50, 75))\n ((50, 75), (68.75, 75), (87.5, 50), (100, 0))\n >>> printSegments(splitCubic((0, 0), (25, 100), (75, 100), (100, 0), 25, True))\n ((0, 0), (2.29379, 9.17517), (4.79804, 17.5085), (7.47414, 25))\n ((7.47414, 25), (31.2886, 91.6667), (68.7114, 91.6667), (92.5259, 25))\n ((92.5259, 25), (95.202, 17.5085), (97.7062, 9.17517), (100, 1.77636e-15))");
|
|
9699
9728
|
static PyMethodDef __pyx_mdef_9fontTools_4misc_11bezierTools_29splitCubic = {"splitCubic", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9fontTools_4misc_11bezierTools_29splitCubic, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9fontTools_4misc_11bezierTools_28splitCubic};
|
|
9700
9729
|
static PyObject *__pyx_pw_9fontTools_4misc_11bezierTools_29splitCubic(PyObject *__pyx_self,
|
|
9701
9730
|
#if CYTHON_METH_FASTCALL
|
|
@@ -10320,7 +10349,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
|
10320
10349
|
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
10321
10350
|
#endif
|
|
10322
10351
|
); /*proto*/
|
|
10323
|
-
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_30splitQuadraticAtT, "splitQuadraticAtT(pt1, pt2, pt3, *ts)\nSplit a quadratic Bezier curve at one or more values of t.\n\nArgs:\n pt1,pt2,pt3: Control points of the Bezier as 2D tuples.\n *ts: Positions at which to split the curve.\n\nReturns:\n A list of curve segments (each curve segment being three 2D tuples).\n\nExamples::\n\n >>> printSegments(splitQuadraticAtT((0, 0), (50, 100), (100, 0), 0.5))\n ((0, 0), (25, 50), (50, 50))\n ((50, 50), (75, 50), (100, 0))\n >>> printSegments(splitQuadraticAtT((0, 0), (50, 100), (100, 0), 0.5, 0.75))\n ((0, 0), (25, 50), (50, 50))\n ((50, 50), (62.5, 50), (75, 37.5))\n ((75, 37.5), (87.5, 25), (100, 0))");
|
|
10352
|
+
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_30splitQuadraticAtT, "splitQuadraticAtT(pt1, pt2, pt3, *ts)\n\nSplit a quadratic Bezier curve at one or more values of t.\n\nArgs:\n pt1,pt2,pt3: Control points of the Bezier as 2D tuples.\n *ts: Positions at which to split the curve.\n\nReturns:\n A list of curve segments (each curve segment being three 2D tuples).\n\nExamples::\n\n >>> printSegments(splitQuadraticAtT((0, 0), (50, 100), (100, 0), 0.5))\n ((0, 0), (25, 50), (50, 50))\n ((50, 50), (75, 50), (100, 0))\n >>> printSegments(splitQuadraticAtT((0, 0), (50, 100), (100, 0), 0.5, 0.75))\n ((0, 0), (25, 50), (50, 50))\n ((50, 50), (62.5, 50), (75, 37.5))\n ((75, 37.5), (87.5, 25), (100, 0))");
|
|
10324
10353
|
static PyMethodDef __pyx_mdef_9fontTools_4misc_11bezierTools_31splitQuadraticAtT = {"splitQuadraticAtT", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9fontTools_4misc_11bezierTools_31splitQuadraticAtT, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9fontTools_4misc_11bezierTools_30splitQuadraticAtT};
|
|
10325
10354
|
static PyObject *__pyx_pw_9fontTools_4misc_11bezierTools_31splitQuadraticAtT(PyObject *__pyx_self,
|
|
10326
10355
|
#if CYTHON_METH_FASTCALL
|
|
@@ -10612,7 +10641,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
|
10612
10641
|
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
10613
10642
|
#endif
|
|
10614
10643
|
); /*proto*/
|
|
10615
|
-
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_32splitCubicAtT, "splitCubicAtT(pt1, pt2, pt3, pt4, *ts)\nSplit a cubic Bezier curve at one or more values of t.\n\nArgs:\n pt1,pt2,pt3,pt4: Control points of the Bezier as 2D tuples.\n *ts: Positions at which to split the curve.\n\nReturns:\n A list of curve segments (each curve segment being four 2D tuples).\n\nExamples::\n\n >>> printSegments(splitCubicAtT((0, 0), (25, 100), (75, 100), (100, 0), 0.5))\n ((0, 0), (12.5, 50), (31.25, 75), (50, 75))\n ((50, 75), (68.75, 75), (87.5, 50), (100, 0))\n >>> printSegments(splitCubicAtT((0, 0), (25, 100), (75, 100), (100, 0), 0.5, 0.75))\n ((0, 0), (12.5, 50), (31.25, 75), (50, 75))\n ((50, 75), (59.375, 75), (68.75, 68.75), (77.3438, 56.25))\n ((77.3438, 56.25), (85.9375, 43.75), (93.75, 25), (100, 0))");
|
|
10644
|
+
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_32splitCubicAtT, "splitCubicAtT(pt1, pt2, pt3, pt4, *ts)\n\nSplit a cubic Bezier curve at one or more values of t.\n\nArgs:\n pt1,pt2,pt3,pt4: Control points of the Bezier as 2D tuples.\n *ts: Positions at which to split the curve.\n\nReturns:\n A list of curve segments (each curve segment being four 2D tuples).\n\nExamples::\n\n >>> printSegments(splitCubicAtT((0, 0), (25, 100), (75, 100), (100, 0), 0.5))\n ((0, 0), (12.5, 50), (31.25, 75), (50, 75))\n ((50, 75), (68.75, 75), (87.5, 50), (100, 0))\n >>> printSegments(splitCubicAtT((0, 0), (25, 100), (75, 100), (100, 0), 0.5, 0.75))\n ((0, 0), (12.5, 50), (31.25, 75), (50, 75))\n ((50, 75), (59.375, 75), (68.75, 68.75), (77.3438, 56.25))\n ((77.3438, 56.25), (85.9375, 43.75), (93.75, 25), (100, 0))");
|
|
10616
10645
|
static PyMethodDef __pyx_mdef_9fontTools_4misc_11bezierTools_33splitCubicAtT = {"splitCubicAtT", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9fontTools_4misc_11bezierTools_33splitCubicAtT, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9fontTools_4misc_11bezierTools_32splitCubicAtT};
|
|
10617
10646
|
static PyObject *__pyx_pw_9fontTools_4misc_11bezierTools_33splitCubicAtT(PyObject *__pyx_self,
|
|
10618
10647
|
#if CYTHON_METH_FASTCALL
|
|
@@ -10898,7 +10927,7 @@ static PyObject *__pyx_pf_9fontTools_4misc_11bezierTools_32splitCubicAtT(CYTHON_
|
|
|
10898
10927
|
if (__Pyx_PyList_SET_ITEM(__pyx_t_5, 0, __pyx_v_pt1) != (0)) __PYX_ERR(0, 639, __pyx_L1_error);
|
|
10899
10928
|
__pyx_t_6 = __pyx_t_5;
|
|
10900
10929
|
__pyx_t_5 = 0;
|
|
10901
|
-
__pyx_t_5 = __Pyx_GetItemInt(__pyx_v_split, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 639, __pyx_L1_error)
|
|
10930
|
+
__pyx_t_5 = __Pyx_GetItemInt(__pyx_v_split, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 639, __pyx_L1_error)
|
|
10902
10931
|
__Pyx_GOTREF(__pyx_t_5);
|
|
10903
10932
|
__pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_5, 1, 0, NULL, NULL, &__pyx_mstate_global->__pyx_slice[0], 1, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 639, __pyx_L1_error)
|
|
10904
10933
|
__Pyx_GOTREF(__pyx_t_1);
|
|
@@ -10911,7 +10940,7 @@ static PyObject *__pyx_pf_9fontTools_4misc_11bezierTools_32splitCubicAtT(CYTHON_
|
|
|
10911
10940
|
__pyx_t_6 = __pyx_temp; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 639, __pyx_L1_error)
|
|
10912
10941
|
__Pyx_GOTREF(__pyx_t_6);
|
|
10913
10942
|
}
|
|
10914
|
-
if (unlikely((__Pyx_SetItemInt(__pyx_v_split, 0, __pyx_t_6, long, 1, __Pyx_PyLong_From_long, 0, 0, 1) < 0))) __PYX_ERR(0, 639, __pyx_L1_error)
|
|
10943
|
+
if (unlikely((__Pyx_SetItemInt(__pyx_v_split, 0, __pyx_t_6, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1) < 0))) __PYX_ERR(0, 639, __pyx_L1_error)
|
|
10915
10944
|
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
10916
10945
|
|
|
10917
10946
|
/* "fontTools/misc/bezierTools.py":640
|
|
@@ -10921,7 +10950,7 @@ static PyObject *__pyx_pf_9fontTools_4misc_11bezierTools_32splitCubicAtT(CYTHON_
|
|
|
10921
10950
|
* return split
|
|
10922
10951
|
*
|
|
10923
10952
|
*/
|
|
10924
|
-
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_split, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 640, __pyx_L1_error)
|
|
10953
|
+
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_split, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 640, __pyx_L1_error)
|
|
10925
10954
|
__Pyx_GOTREF(__pyx_t_1);
|
|
10926
10955
|
__pyx_t_5 = __Pyx_PyObject_GetSlice(__pyx_t_1, 0, -1L, NULL, NULL, &__pyx_mstate_global->__pyx_slice[1], 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 640, __pyx_L1_error)
|
|
10927
10956
|
__Pyx_GOTREF(__pyx_t_5);
|
|
@@ -10936,7 +10965,7 @@ static PyObject *__pyx_pf_9fontTools_4misc_11bezierTools_32splitCubicAtT(CYTHON_
|
|
|
10936
10965
|
__pyx_t_6 = __pyx_temp; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 640, __pyx_L1_error)
|
|
10937
10966
|
__Pyx_GOTREF(__pyx_t_6);
|
|
10938
10967
|
}
|
|
10939
|
-
if (unlikely((__Pyx_SetItemInt(__pyx_v_split, -1L, __pyx_t_6, long, 1, __Pyx_PyLong_From_long, 0, 1, 1) < 0))) __PYX_ERR(0, 640, __pyx_L1_error)
|
|
10968
|
+
if (unlikely((__Pyx_SetItemInt(__pyx_v_split, -1L, __pyx_t_6, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1) < 0))) __PYX_ERR(0, 640, __pyx_L1_error)
|
|
10940
10969
|
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
10941
10970
|
|
|
10942
10971
|
/* "fontTools/misc/bezierTools.py":641
|
|
@@ -10997,7 +11026,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
|
10997
11026
|
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
10998
11027
|
#endif
|
|
10999
11028
|
); /*proto*/
|
|
11000
|
-
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_34splitCubicAtTC, "splitCubicAtTC(double complex pt1, double complex pt2, double complex pt3, double complex pt4, *ts)\nSplit a cubic Bezier curve at one or more values of t.\n\nArgs:\n pt1,pt2,pt3,pt4: Control points of the Bezier as complex numbers..\n *ts: Positions at which to split the curve.\n\nYields:\n Curve segments (each curve segment being four complex numbers).");
|
|
11029
|
+
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_34splitCubicAtTC, "splitCubicAtTC(double complex pt1, double complex pt2, double complex pt3, double complex pt4, *ts)\n\nSplit a cubic Bezier curve at one or more values of t.\n\nArgs:\n pt1,pt2,pt3,pt4: Control points of the Bezier as complex numbers..\n *ts: Positions at which to split the curve.\n\nYields:\n Curve segments (each curve segment being four complex numbers).");
|
|
11001
11030
|
static PyMethodDef __pyx_mdef_9fontTools_4misc_11bezierTools_35splitCubicAtTC = {"splitCubicAtTC", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9fontTools_4misc_11bezierTools_35splitCubicAtTC, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9fontTools_4misc_11bezierTools_34splitCubicAtTC};
|
|
11002
11031
|
static PyObject *__pyx_pw_9fontTools_4misc_11bezierTools_35splitCubicAtTC(PyObject *__pyx_self,
|
|
11003
11032
|
#if CYTHON_METH_FASTCALL
|
|
@@ -11380,7 +11409,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
|
11380
11409
|
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
11381
11410
|
#endif
|
|
11382
11411
|
); /*proto*/
|
|
11383
|
-
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_37splitCubicIntoTwoAtTC, "splitCubicIntoTwoAtTC(double complex pt1, double complex pt2, double complex pt3, double complex pt4, double t)\nSplit a cubic Bezier curve at t.\n\nArgs:\n pt1,pt2,pt3,pt4: Control points of the Bezier as complex numbers.\n t: Position at which to split the curve.\n\nReturns:\n A tuple of two curve segments (each curve segment being four complex numbers).");
|
|
11412
|
+
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_37splitCubicIntoTwoAtTC, "splitCubicIntoTwoAtTC(double complex pt1, double complex pt2, double complex pt3, double complex pt4, double t)\n\nSplit a cubic Bezier curve at t.\n\nArgs:\n pt1,pt2,pt3,pt4: Control points of the Bezier as complex numbers.\n t: Position at which to split the curve.\n\nReturns:\n A tuple of two curve segments (each curve segment being four complex numbers).");
|
|
11384
11413
|
static PyMethodDef __pyx_mdef_9fontTools_4misc_11bezierTools_38splitCubicIntoTwoAtTC = {"splitCubicIntoTwoAtTC", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9fontTools_4misc_11bezierTools_38splitCubicIntoTwoAtTC, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9fontTools_4misc_11bezierTools_37splitCubicIntoTwoAtTC};
|
|
11385
11414
|
static PyObject *__pyx_pw_9fontTools_4misc_11bezierTools_38splitCubicIntoTwoAtTC(PyObject *__pyx_self,
|
|
11386
11415
|
#if CYTHON_METH_FASTCALL
|
|
@@ -14263,7 +14292,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
|
14263
14292
|
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
14264
14293
|
#endif
|
|
14265
14294
|
); /*proto*/
|
|
14266
|
-
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_46solveQuadratic, "solveQuadratic(a, b, c, sqrt=sqrt)\nSolve a quadratic equation.\n\nSolves *a*x*x + b*x + c = 0* where a, b and c are real.\n\nArgs:\n a: coefficient of *x\302\262*\n b: coefficient of *x*\n c: constant term\n\nReturns:\n A list of roots. Note that the returned list is neither guaranteed to\n be sorted nor to contain unique values!");
|
|
14295
|
+
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_46solveQuadratic, "solveQuadratic(a, b, c, sqrt=sqrt)\n\nSolve a quadratic equation.\n\nSolves *a*x*x + b*x + c = 0* where a, b and c are real.\n\nArgs:\n a: coefficient of *x\302\262*\n b: coefficient of *x*\n c: constant term\n\nReturns:\n A list of roots. Note that the returned list is neither guaranteed to\n be sorted nor to contain unique values!");
|
|
14267
14296
|
static PyMethodDef __pyx_mdef_9fontTools_4misc_11bezierTools_47solveQuadratic = {"solveQuadratic", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9fontTools_4misc_11bezierTools_47solveQuadratic, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9fontTools_4misc_11bezierTools_46solveQuadratic};
|
|
14268
14297
|
static PyObject *__pyx_pw_9fontTools_4misc_11bezierTools_47solveQuadratic(PyObject *__pyx_self,
|
|
14269
14298
|
#if CYTHON_METH_FASTCALL
|
|
@@ -14666,7 +14695,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
|
14666
14695
|
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
14667
14696
|
#endif
|
|
14668
14697
|
); /*proto*/
|
|
14669
|
-
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_48solveCubic, "solveCubic(a, b, c, d)\nSolve a cubic equation.\n\nSolves *a*x*x*x + b*x*x + c*x + d = 0* where a, b, c and d are real.\n\nArgs:\n a: coefficient of *x\302\263*\n b: coefficient of *x\302\262*\n c: coefficient of *x*\n d: constant term\n\nReturns:\n A list of roots. Note that the returned list is neither guaranteed to\n be sorted nor to contain unique values!\n\nExamples::\n\n >>> solveCubic(1, 1, -6, 0)\n [-3.0, -0.0, 2.0]\n >>> solveCubic(-10.0, -9.0, 48.0, -29.0)\n [-2.9, 1.0, 1.0]\n >>> solveCubic(-9.875, -9.0, 47.625, -28.75)\n [-2.911392, 1.0, 1.0]\n >>> solveCubic(1.0, -4.5, 6.75, -3.375)\n [1.5, 1.5, 1.5]\n >>> solveCubic(-12.0, 18.0, -9.0, 1.50023651123)\n [0.5, 0.5, 0.5]\n >>> solveCubic(\n ... 9.0, 0.0, 0.0, -7.62939453125e-05\n ... ) == [-0.0, -0.0, -0.0]\n True");
|
|
14698
|
+
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_48solveCubic, "solveCubic(a, b, c, d)\n\nSolve a cubic equation.\n\nSolves *a*x*x*x + b*x*x + c*x + d = 0* where a, b, c and d are real.\n\nArgs:\n a: coefficient of *x\302\263*\n b: coefficient of *x\302\262*\n c: coefficient of *x*\n d: constant term\n\nReturns:\n A list of roots. Note that the returned list is neither guaranteed to\n be sorted nor to contain unique values!\n\nExamples::\n\n >>> solveCubic(1, 1, -6, 0)\n [-3.0, -0.0, 2.0]\n >>> solveCubic(-10.0, -9.0, 48.0, -29.0)\n [-2.9, 1.0, 1.0]\n >>> solveCubic(-9.875, -9.0, 47.625, -28.75)\n [-2.911392, 1.0, 1.0]\n >>> solveCubic(1.0, -4.5, 6.75, -3.375)\n [1.5, 1.5, 1.5]\n >>> solveCubic(-12.0, 18.0, -9.0, 1.50023651123)\n [0.5, 0.5, 0.5]\n >>> solveCubic(\n ... 9.0, 0.0, 0.0, -7.62939453125e-05\n ... ) == [-0.0, -0.0, -0.0]\n True");
|
|
14670
14699
|
static PyMethodDef __pyx_mdef_9fontTools_4misc_11bezierTools_49solveCubic = {"solveCubic", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9fontTools_4misc_11bezierTools_49solveCubic, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9fontTools_4misc_11bezierTools_48solveCubic};
|
|
14671
14700
|
static PyObject *__pyx_pw_9fontTools_4misc_11bezierTools_49solveCubic(PyObject *__pyx_self,
|
|
14672
14701
|
#if CYTHON_METH_FASTCALL
|
|
@@ -18402,7 +18431,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
|
18402
18431
|
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
18403
18432
|
#endif
|
|
18404
18433
|
); /*proto*/
|
|
18405
|
-
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_58linePointAtT, "linePointAtT(pt1, pt2, t)\nFinds the point at time `t` on a line.\n\nArgs:\n pt1, pt2: Coordinates of the line as 2D tuples.\n t: The time along the line.\n\nReturns:\n A 2D tuple with the coordinates of the point.");
|
|
18434
|
+
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_58linePointAtT, "linePointAtT(pt1, pt2, t)\n\nFinds the point at time `t` on a line.\n\nArgs:\n pt1, pt2: Coordinates of the line as 2D tuples.\n t: The time along the line.\n\nReturns:\n A 2D tuple with the coordinates of the point.");
|
|
18406
18435
|
static PyMethodDef __pyx_mdef_9fontTools_4misc_11bezierTools_59linePointAtT = {"linePointAtT", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9fontTools_4misc_11bezierTools_59linePointAtT, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9fontTools_4misc_11bezierTools_58linePointAtT};
|
|
18407
18436
|
static PyObject *__pyx_pw_9fontTools_4misc_11bezierTools_59linePointAtT(PyObject *__pyx_self,
|
|
18408
18437
|
#if CYTHON_METH_FASTCALL
|
|
@@ -18516,7 +18545,7 @@ static PyObject *__pyx_pf_9fontTools_4misc_11bezierTools_58linePointAtT(CYTHON_U
|
|
|
18516
18545
|
*
|
|
18517
18546
|
*/
|
|
18518
18547
|
__Pyx_XDECREF(__pyx_r);
|
|
18519
|
-
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_pt1, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1050, __pyx_L1_error)
|
|
18548
|
+
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_pt1, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1050, __pyx_L1_error)
|
|
18520
18549
|
__Pyx_GOTREF(__pyx_t_1);
|
|
18521
18550
|
__pyx_t_2 = __Pyx_PyLong_SubtractCObj(__pyx_mstate_global->__pyx_int_1, __pyx_v_t, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1050, __pyx_L1_error)
|
|
18522
18551
|
__Pyx_GOTREF(__pyx_t_2);
|
|
@@ -18524,7 +18553,7 @@ static PyObject *__pyx_pf_9fontTools_4misc_11bezierTools_58linePointAtT(CYTHON_U
|
|
|
18524
18553
|
__Pyx_GOTREF(__pyx_t_3);
|
|
18525
18554
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
18526
18555
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
18527
|
-
__pyx_t_2 = __Pyx_GetItemInt(__pyx_v_pt2, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1050, __pyx_L1_error)
|
|
18556
|
+
__pyx_t_2 = __Pyx_GetItemInt(__pyx_v_pt2, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1050, __pyx_L1_error)
|
|
18528
18557
|
__Pyx_GOTREF(__pyx_t_2);
|
|
18529
18558
|
__pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_v_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1050, __pyx_L1_error)
|
|
18530
18559
|
__Pyx_GOTREF(__pyx_t_1);
|
|
@@ -18533,7 +18562,7 @@ static PyObject *__pyx_pf_9fontTools_4misc_11bezierTools_58linePointAtT(CYTHON_U
|
|
|
18533
18562
|
__Pyx_GOTREF(__pyx_t_2);
|
|
18534
18563
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
18535
18564
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
18536
|
-
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_pt1, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1050, __pyx_L1_error)
|
|
18565
|
+
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_pt1, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1050, __pyx_L1_error)
|
|
18537
18566
|
__Pyx_GOTREF(__pyx_t_1);
|
|
18538
18567
|
__pyx_t_3 = __Pyx_PyLong_SubtractCObj(__pyx_mstate_global->__pyx_int_1, __pyx_v_t, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1050, __pyx_L1_error)
|
|
18539
18568
|
__Pyx_GOTREF(__pyx_t_3);
|
|
@@ -18541,7 +18570,7 @@ static PyObject *__pyx_pf_9fontTools_4misc_11bezierTools_58linePointAtT(CYTHON_U
|
|
|
18541
18570
|
__Pyx_GOTREF(__pyx_t_4);
|
|
18542
18571
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
18543
18572
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
18544
|
-
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pt2, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1050, __pyx_L1_error)
|
|
18573
|
+
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pt2, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1050, __pyx_L1_error)
|
|
18545
18574
|
__Pyx_GOTREF(__pyx_t_3);
|
|
18546
18575
|
__pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_v_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1050, __pyx_L1_error)
|
|
18547
18576
|
__Pyx_GOTREF(__pyx_t_1);
|
|
@@ -18600,7 +18629,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
|
18600
18629
|
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
18601
18630
|
#endif
|
|
18602
18631
|
); /*proto*/
|
|
18603
|
-
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_60quadraticPointAtT, "quadraticPointAtT(pt1, pt2, pt3, t)\nFinds the point at time `t` on a quadratic curve.\n\nArgs:\n pt1, pt2, pt3: Coordinates of the curve as 2D tuples.\n t: The time along the curve.\n\nReturns:\n A 2D tuple with the coordinates of the point.");
|
|
18632
|
+
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_60quadraticPointAtT, "quadraticPointAtT(pt1, pt2, pt3, t)\n\nFinds the point at time `t` on a quadratic curve.\n\nArgs:\n pt1, pt2, pt3: Coordinates of the curve as 2D tuples.\n t: The time along the curve.\n\nReturns:\n A 2D tuple with the coordinates of the point.");
|
|
18604
18633
|
static PyMethodDef __pyx_mdef_9fontTools_4misc_11bezierTools_61quadraticPointAtT = {"quadraticPointAtT", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9fontTools_4misc_11bezierTools_61quadraticPointAtT, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9fontTools_4misc_11bezierTools_60quadraticPointAtT};
|
|
18605
18634
|
static PyObject *__pyx_pw_9fontTools_4misc_11bezierTools_61quadraticPointAtT(PyObject *__pyx_self,
|
|
18606
18635
|
#if CYTHON_METH_FASTCALL
|
|
@@ -18731,7 +18760,7 @@ static PyObject *__pyx_pf_9fontTools_4misc_11bezierTools_60quadraticPointAtT(CYT
|
|
|
18731
18760
|
__Pyx_GOTREF(__pyx_t_3);
|
|
18732
18761
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
18733
18762
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
18734
|
-
__pyx_t_2 = __Pyx_GetItemInt(__pyx_v_pt1, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1063, __pyx_L1_error)
|
|
18763
|
+
__pyx_t_2 = __Pyx_GetItemInt(__pyx_v_pt1, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1063, __pyx_L1_error)
|
|
18735
18764
|
__Pyx_GOTREF(__pyx_t_2);
|
|
18736
18765
|
__pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1063, __pyx_L1_error)
|
|
18737
18766
|
__Pyx_GOTREF(__pyx_t_1);
|
|
@@ -18745,7 +18774,7 @@ static PyObject *__pyx_pf_9fontTools_4misc_11bezierTools_60quadraticPointAtT(CYT
|
|
|
18745
18774
|
__pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_v_t); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1063, __pyx_L1_error)
|
|
18746
18775
|
__Pyx_GOTREF(__pyx_t_2);
|
|
18747
18776
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
18748
|
-
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pt2, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1063, __pyx_L1_error)
|
|
18777
|
+
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pt2, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1063, __pyx_L1_error)
|
|
18749
18778
|
__Pyx_GOTREF(__pyx_t_3);
|
|
18750
18779
|
__pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1063, __pyx_L1_error)
|
|
18751
18780
|
__Pyx_GOTREF(__pyx_t_4);
|
|
@@ -18757,7 +18786,7 @@ static PyObject *__pyx_pf_9fontTools_4misc_11bezierTools_60quadraticPointAtT(CYT
|
|
|
18757
18786
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
18758
18787
|
__pyx_t_4 = PyNumber_Multiply(__pyx_v_t, __pyx_v_t); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1063, __pyx_L1_error)
|
|
18759
18788
|
__Pyx_GOTREF(__pyx_t_4);
|
|
18760
|
-
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_pt3, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1063, __pyx_L1_error)
|
|
18789
|
+
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_pt3, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1063, __pyx_L1_error)
|
|
18761
18790
|
__Pyx_GOTREF(__pyx_t_1);
|
|
18762
18791
|
__pyx_t_2 = PyNumber_Multiply(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1063, __pyx_L1_error)
|
|
18763
18792
|
__Pyx_GOTREF(__pyx_t_2);
|
|
@@ -18785,7 +18814,7 @@ static PyObject *__pyx_pf_9fontTools_4misc_11bezierTools_60quadraticPointAtT(CYT
|
|
|
18785
18814
|
__Pyx_GOTREF(__pyx_t_3);
|
|
18786
18815
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
18787
18816
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
18788
|
-
__pyx_t_2 = __Pyx_GetItemInt(__pyx_v_pt1, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1064, __pyx_L1_error)
|
|
18817
|
+
__pyx_t_2 = __Pyx_GetItemInt(__pyx_v_pt1, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1064, __pyx_L1_error)
|
|
18789
18818
|
__Pyx_GOTREF(__pyx_t_2);
|
|
18790
18819
|
__pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1064, __pyx_L1_error)
|
|
18791
18820
|
__Pyx_GOTREF(__pyx_t_1);
|
|
@@ -18799,7 +18828,7 @@ static PyObject *__pyx_pf_9fontTools_4misc_11bezierTools_60quadraticPointAtT(CYT
|
|
|
18799
18828
|
__pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_v_t); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1064, __pyx_L1_error)
|
|
18800
18829
|
__Pyx_GOTREF(__pyx_t_2);
|
|
18801
18830
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
18802
|
-
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pt2, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1064, __pyx_L1_error)
|
|
18831
|
+
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pt2, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1064, __pyx_L1_error)
|
|
18803
18832
|
__Pyx_GOTREF(__pyx_t_3);
|
|
18804
18833
|
__pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1064, __pyx_L1_error)
|
|
18805
18834
|
__Pyx_GOTREF(__pyx_t_4);
|
|
@@ -18811,7 +18840,7 @@ static PyObject *__pyx_pf_9fontTools_4misc_11bezierTools_60quadraticPointAtT(CYT
|
|
|
18811
18840
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
18812
18841
|
__pyx_t_4 = PyNumber_Multiply(__pyx_v_t, __pyx_v_t); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1064, __pyx_L1_error)
|
|
18813
18842
|
__Pyx_GOTREF(__pyx_t_4);
|
|
18814
|
-
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_pt3, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1064, __pyx_L1_error)
|
|
18843
|
+
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_pt3, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1064, __pyx_L1_error)
|
|
18815
18844
|
__Pyx_GOTREF(__pyx_t_1);
|
|
18816
18845
|
__pyx_t_2 = PyNumber_Multiply(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1064, __pyx_L1_error)
|
|
18817
18846
|
__Pyx_GOTREF(__pyx_t_2);
|
|
@@ -18884,7 +18913,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
|
18884
18913
|
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
18885
18914
|
#endif
|
|
18886
18915
|
); /*proto*/
|
|
18887
|
-
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_62cubicPointAtT, "cubicPointAtT(pt1, pt2, pt3, pt4, t)\nFinds the point at time `t` on a cubic curve.\n\nArgs:\n pt1, pt2, pt3, pt4: Coordinates of the curve as 2D tuples.\n t: The time along the curve.\n\nReturns:\n A 2D tuple with the coordinates of the point.");
|
|
18916
|
+
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_62cubicPointAtT, "cubicPointAtT(pt1, pt2, pt3, pt4, t)\n\nFinds the point at time `t` on a cubic curve.\n\nArgs:\n pt1, pt2, pt3, pt4: Coordinates of the curve as 2D tuples.\n t: The time along the curve.\n\nReturns:\n A 2D tuple with the coordinates of the point.");
|
|
18888
18917
|
static PyMethodDef __pyx_mdef_9fontTools_4misc_11bezierTools_63cubicPointAtT = {"cubicPointAtT", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9fontTools_4misc_11bezierTools_63cubicPointAtT, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9fontTools_4misc_11bezierTools_62cubicPointAtT};
|
|
18889
18918
|
static PyObject *__pyx_pw_9fontTools_4misc_11bezierTools_63cubicPointAtT(PyObject *__pyx_self,
|
|
18890
18919
|
#if CYTHON_METH_FASTCALL
|
|
@@ -19057,7 +19086,7 @@ static PyObject *__pyx_pf_9fontTools_4misc_11bezierTools_62cubicPointAtT(CYTHON_
|
|
|
19057
19086
|
*/
|
|
19058
19087
|
__pyx_t_1 = PyNumber_Multiply(__pyx_v__1_t_2, __pyx_v__1_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1082, __pyx_L1_error)
|
|
19059
19088
|
__Pyx_GOTREF(__pyx_t_1);
|
|
19060
|
-
__pyx_t_2 = __Pyx_GetItemInt(__pyx_v_pt1, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1082, __pyx_L1_error)
|
|
19089
|
+
__pyx_t_2 = __Pyx_GetItemInt(__pyx_v_pt1, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1082, __pyx_L1_error)
|
|
19061
19090
|
__Pyx_GOTREF(__pyx_t_2);
|
|
19062
19091
|
__pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1082, __pyx_L1_error)
|
|
19063
19092
|
__Pyx_GOTREF(__pyx_t_3);
|
|
@@ -19073,7 +19102,7 @@ static PyObject *__pyx_pf_9fontTools_4misc_11bezierTools_62cubicPointAtT(CYTHON_
|
|
|
19073
19102
|
*/
|
|
19074
19103
|
__pyx_t_2 = PyNumber_Multiply(__pyx_v__1_t_2, __pyx_v_t); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1083, __pyx_L1_error)
|
|
19075
19104
|
__Pyx_GOTREF(__pyx_t_2);
|
|
19076
|
-
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_pt2, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1083, __pyx_L1_error)
|
|
19105
|
+
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_pt2, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1083, __pyx_L1_error)
|
|
19077
19106
|
__Pyx_GOTREF(__pyx_t_1);
|
|
19078
19107
|
__pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1083, __pyx_L1_error)
|
|
19079
19108
|
__Pyx_GOTREF(__pyx_t_4);
|
|
@@ -19081,7 +19110,7 @@ static PyObject *__pyx_pf_9fontTools_4misc_11bezierTools_62cubicPointAtT(CYTHON_
|
|
|
19081
19110
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
19082
19111
|
__pyx_t_1 = PyNumber_Multiply(__pyx_v__1_t, __pyx_v_t2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1083, __pyx_L1_error)
|
|
19083
19112
|
__Pyx_GOTREF(__pyx_t_1);
|
|
19084
|
-
__pyx_t_2 = __Pyx_GetItemInt(__pyx_v_pt3, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1083, __pyx_L1_error)
|
|
19113
|
+
__pyx_t_2 = __Pyx_GetItemInt(__pyx_v_pt3, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1083, __pyx_L1_error)
|
|
19085
19114
|
__Pyx_GOTREF(__pyx_t_2);
|
|
19086
19115
|
__pyx_t_5 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1083, __pyx_L1_error)
|
|
19087
19116
|
__Pyx_GOTREF(__pyx_t_5);
|
|
@@ -19108,7 +19137,7 @@ static PyObject *__pyx_pf_9fontTools_4misc_11bezierTools_62cubicPointAtT(CYTHON_
|
|
|
19108
19137
|
*/
|
|
19109
19138
|
__pyx_t_5 = PyNumber_Multiply(__pyx_v_t2, __pyx_v_t); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1084, __pyx_L1_error)
|
|
19110
19139
|
__Pyx_GOTREF(__pyx_t_5);
|
|
19111
|
-
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pt4, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1084, __pyx_L1_error)
|
|
19140
|
+
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pt4, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1084, __pyx_L1_error)
|
|
19112
19141
|
__Pyx_GOTREF(__pyx_t_3);
|
|
19113
19142
|
__pyx_t_4 = PyNumber_Multiply(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1084, __pyx_L1_error)
|
|
19114
19143
|
__Pyx_GOTREF(__pyx_t_4);
|
|
@@ -19130,7 +19159,7 @@ static PyObject *__pyx_pf_9fontTools_4misc_11bezierTools_62cubicPointAtT(CYTHON_
|
|
|
19130
19159
|
*/
|
|
19131
19160
|
__pyx_t_3 = PyNumber_Multiply(__pyx_v__1_t_2, __pyx_v__1_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1087, __pyx_L1_error)
|
|
19132
19161
|
__Pyx_GOTREF(__pyx_t_3);
|
|
19133
|
-
__pyx_t_4 = __Pyx_GetItemInt(__pyx_v_pt1, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1087, __pyx_L1_error)
|
|
19162
|
+
__pyx_t_4 = __Pyx_GetItemInt(__pyx_v_pt1, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1087, __pyx_L1_error)
|
|
19134
19163
|
__Pyx_GOTREF(__pyx_t_4);
|
|
19135
19164
|
__pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1087, __pyx_L1_error)
|
|
19136
19165
|
__Pyx_GOTREF(__pyx_t_2);
|
|
@@ -19146,7 +19175,7 @@ static PyObject *__pyx_pf_9fontTools_4misc_11bezierTools_62cubicPointAtT(CYTHON_
|
|
|
19146
19175
|
*/
|
|
19147
19176
|
__pyx_t_4 = PyNumber_Multiply(__pyx_v__1_t_2, __pyx_v_t); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1088, __pyx_L1_error)
|
|
19148
19177
|
__Pyx_GOTREF(__pyx_t_4);
|
|
19149
|
-
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pt2, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1088, __pyx_L1_error)
|
|
19178
|
+
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_pt2, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1088, __pyx_L1_error)
|
|
19150
19179
|
__Pyx_GOTREF(__pyx_t_3);
|
|
19151
19180
|
__pyx_t_5 = PyNumber_Multiply(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1088, __pyx_L1_error)
|
|
19152
19181
|
__Pyx_GOTREF(__pyx_t_5);
|
|
@@ -19154,7 +19183,7 @@ static PyObject *__pyx_pf_9fontTools_4misc_11bezierTools_62cubicPointAtT(CYTHON_
|
|
|
19154
19183
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
19155
19184
|
__pyx_t_3 = PyNumber_Multiply(__pyx_v__1_t, __pyx_v_t2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1088, __pyx_L1_error)
|
|
19156
19185
|
__Pyx_GOTREF(__pyx_t_3);
|
|
19157
|
-
__pyx_t_4 = __Pyx_GetItemInt(__pyx_v_pt3, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1088, __pyx_L1_error)
|
|
19186
|
+
__pyx_t_4 = __Pyx_GetItemInt(__pyx_v_pt3, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1088, __pyx_L1_error)
|
|
19158
19187
|
__Pyx_GOTREF(__pyx_t_4);
|
|
19159
19188
|
__pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1088, __pyx_L1_error)
|
|
19160
19189
|
__Pyx_GOTREF(__pyx_t_1);
|
|
@@ -19181,7 +19210,7 @@ static PyObject *__pyx_pf_9fontTools_4misc_11bezierTools_62cubicPointAtT(CYTHON_
|
|
|
19181
19210
|
*/
|
|
19182
19211
|
__pyx_t_1 = PyNumber_Multiply(__pyx_v_t2, __pyx_v_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1089, __pyx_L1_error)
|
|
19183
19212
|
__Pyx_GOTREF(__pyx_t_1);
|
|
19184
|
-
__pyx_t_2 = __Pyx_GetItemInt(__pyx_v_pt4, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1089, __pyx_L1_error)
|
|
19213
|
+
__pyx_t_2 = __Pyx_GetItemInt(__pyx_v_pt4, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1089, __pyx_L1_error)
|
|
19185
19214
|
__Pyx_GOTREF(__pyx_t_2);
|
|
19186
19215
|
__pyx_t_5 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1089, __pyx_L1_error)
|
|
19187
19216
|
__Pyx_GOTREF(__pyx_t_5);
|
|
@@ -19258,7 +19287,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
|
19258
19287
|
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
19259
19288
|
#endif
|
|
19260
19289
|
); /*proto*/
|
|
19261
|
-
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_64cubicPointAtTC, "cubicPointAtTC(double complex pt1, double complex pt2, double complex pt3, double complex pt4, double t)\nFinds the point at time `t` on a cubic curve.\n\nArgs:\n pt1, pt2, pt3, pt4: Coordinates of the curve as complex numbers.\n t: The time along the curve.\n\nReturns:\n A complex number with the coordinates of the point.");
|
|
19290
|
+
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_64cubicPointAtTC, "cubicPointAtTC(double complex pt1, double complex pt2, double complex pt3, double complex pt4, double t)\n\nFinds the point at time `t` on a cubic curve.\n\nArgs:\n pt1, pt2, pt3, pt4: Coordinates of the curve as complex numbers.\n t: The time along the curve.\n\nReturns:\n A complex number with the coordinates of the point.");
|
|
19262
19291
|
static PyMethodDef __pyx_mdef_9fontTools_4misc_11bezierTools_65cubicPointAtTC = {"cubicPointAtTC", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9fontTools_4misc_11bezierTools_65cubicPointAtTC, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9fontTools_4misc_11bezierTools_64cubicPointAtTC};
|
|
19263
19292
|
static PyObject *__pyx_pw_9fontTools_4misc_11bezierTools_65cubicPointAtTC(PyObject *__pyx_self,
|
|
19264
19293
|
#if CYTHON_METH_FASTCALL
|
|
@@ -20357,17 +20386,17 @@ static PyObject *__pyx_pf_9fontTools_4misc_11bezierTools_70_both_points_are_on_s
|
|
|
20357
20386
|
* yDiff = (a[1] - origin[1]) * (b[1] - origin[1])
|
|
20358
20387
|
* return not (xDiff <= 0.0 and yDiff <= 0.0)
|
|
20359
20388
|
*/
|
|
20360
|
-
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_a, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1149, __pyx_L1_error)
|
|
20389
|
+
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_a, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1149, __pyx_L1_error)
|
|
20361
20390
|
__Pyx_GOTREF(__pyx_t_1);
|
|
20362
|
-
__pyx_t_2 = __Pyx_GetItemInt(__pyx_v_origin, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1149, __pyx_L1_error)
|
|
20391
|
+
__pyx_t_2 = __Pyx_GetItemInt(__pyx_v_origin, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1149, __pyx_L1_error)
|
|
20363
20392
|
__Pyx_GOTREF(__pyx_t_2);
|
|
20364
20393
|
__pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1149, __pyx_L1_error)
|
|
20365
20394
|
__Pyx_GOTREF(__pyx_t_3);
|
|
20366
20395
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
20367
20396
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
20368
|
-
__pyx_t_2 = __Pyx_GetItemInt(__pyx_v_b, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1149, __pyx_L1_error)
|
|
20397
|
+
__pyx_t_2 = __Pyx_GetItemInt(__pyx_v_b, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1149, __pyx_L1_error)
|
|
20369
20398
|
__Pyx_GOTREF(__pyx_t_2);
|
|
20370
|
-
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_origin, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1149, __pyx_L1_error)
|
|
20399
|
+
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_origin, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1149, __pyx_L1_error)
|
|
20371
20400
|
__Pyx_GOTREF(__pyx_t_1);
|
|
20372
20401
|
__pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1149, __pyx_L1_error)
|
|
20373
20402
|
__Pyx_GOTREF(__pyx_t_4);
|
|
@@ -20387,17 +20416,17 @@ static PyObject *__pyx_pf_9fontTools_4misc_11bezierTools_70_both_points_are_on_s
|
|
|
20387
20416
|
* return not (xDiff <= 0.0 and yDiff <= 0.0)
|
|
20388
20417
|
*
|
|
20389
20418
|
*/
|
|
20390
|
-
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_a, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1150, __pyx_L1_error)
|
|
20419
|
+
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_a, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1150, __pyx_L1_error)
|
|
20391
20420
|
__Pyx_GOTREF(__pyx_t_1);
|
|
20392
|
-
__pyx_t_4 = __Pyx_GetItemInt(__pyx_v_origin, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1150, __pyx_L1_error)
|
|
20421
|
+
__pyx_t_4 = __Pyx_GetItemInt(__pyx_v_origin, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1150, __pyx_L1_error)
|
|
20393
20422
|
__Pyx_GOTREF(__pyx_t_4);
|
|
20394
20423
|
__pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1150, __pyx_L1_error)
|
|
20395
20424
|
__Pyx_GOTREF(__pyx_t_3);
|
|
20396
20425
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
20397
20426
|
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
|
20398
|
-
__pyx_t_4 = __Pyx_GetItemInt(__pyx_v_b, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1150, __pyx_L1_error)
|
|
20427
|
+
__pyx_t_4 = __Pyx_GetItemInt(__pyx_v_b, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1150, __pyx_L1_error)
|
|
20399
20428
|
__Pyx_GOTREF(__pyx_t_4);
|
|
20400
|
-
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_origin, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1150, __pyx_L1_error)
|
|
20429
|
+
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_origin, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1150, __pyx_L1_error)
|
|
20401
20430
|
__Pyx_GOTREF(__pyx_t_1);
|
|
20402
20431
|
__pyx_t_2 = PyNumber_Subtract(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1150, __pyx_L1_error)
|
|
20403
20432
|
__Pyx_GOTREF(__pyx_t_2);
|
|
@@ -20477,7 +20506,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
|
20477
20506
|
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
20478
20507
|
#endif
|
|
20479
20508
|
); /*proto*/
|
|
20480
|
-
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_72lineLineIntersections, "lineLineIntersections(s1, e1, s2, e2)\nFinds intersections between two line segments.\n\nArgs:\n s1, e1: Coordinates of the first line as 2D tuples.\n s2, e2: Coordinates of the second line as 2D tuples.\n\nReturns:\n A list of ``Intersection`` objects, each object having ``pt``, ``t1``\n and ``t2`` attributes containing the intersection point, time on first\n segment and time on second segment respectively.\n\nExamples::\n\n >>> a = lineLineIntersections( (310,389), (453, 222), (289, 251), (447, 367))\n >>> len(a)\n 1\n >>> intersection = a[0]\n >>> intersection.pt\n (374.44882952482897, 313.73458370177315)\n >>> (intersection.t1, intersection.t2)\n (0.45069111555824465, 0.5408153767394238)");
|
|
20509
|
+
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_72lineLineIntersections, "lineLineIntersections(s1, e1, s2, e2)\n\nFinds intersections between two line segments.\n\nArgs:\n s1, e1: Coordinates of the first line as 2D tuples.\n s2, e2: Coordinates of the second line as 2D tuples.\n\nReturns:\n A list of ``Intersection`` objects, each object having ``pt``, ``t1``\n and ``t2`` attributes containing the intersection point, time on first\n segment and time on second segment respectively.\n\nExamples::\n\n >>> a = lineLineIntersections( (310,389), (453, 222), (289, 251), (447, 367))\n >>> len(a)\n 1\n >>> intersection = a[0]\n >>> intersection.pt\n (374.44882952482897, 313.73458370177315)\n >>> (intersection.t1, intersection.t2)\n (0.45069111555824465, 0.5408153767394238)");
|
|
20481
20510
|
static PyMethodDef __pyx_mdef_9fontTools_4misc_11bezierTools_73lineLineIntersections = {"lineLineIntersections", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9fontTools_4misc_11bezierTools_73lineLineIntersections, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9fontTools_4misc_11bezierTools_72lineLineIntersections};
|
|
20482
20511
|
static PyObject *__pyx_pw_9fontTools_4misc_11bezierTools_73lineLineIntersections(PyObject *__pyx_self,
|
|
20483
20512
|
#if CYTHON_METH_FASTCALL
|
|
@@ -22331,7 +22360,7 @@ static PyObject *__pyx_pf_9fontTools_4misc_11bezierTools_74_alignment_transforma
|
|
|
22331
22360
|
* end = segment[-1]
|
|
22332
22361
|
* angle = math.atan2(end[1] - start[1], end[0] - start[0])
|
|
22333
22362
|
*/
|
|
22334
|
-
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_segment, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1236, __pyx_L1_error)
|
|
22363
|
+
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_segment, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1236, __pyx_L1_error)
|
|
22335
22364
|
__Pyx_GOTREF(__pyx_t_1);
|
|
22336
22365
|
__pyx_v_start = __pyx_t_1;
|
|
22337
22366
|
__pyx_t_1 = 0;
|
|
@@ -22343,7 +22372,7 @@ static PyObject *__pyx_pf_9fontTools_4misc_11bezierTools_74_alignment_transforma
|
|
|
22343
22372
|
* angle = math.atan2(end[1] - start[1], end[0] - start[0])
|
|
22344
22373
|
* return Identity.rotate(-angle).translate(-start[0], -start[1])
|
|
22345
22374
|
*/
|
|
22346
|
-
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_segment, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1237, __pyx_L1_error)
|
|
22375
|
+
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_segment, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1237, __pyx_L1_error)
|
|
22347
22376
|
__Pyx_GOTREF(__pyx_t_1);
|
|
22348
22377
|
__pyx_v_end = __pyx_t_1;
|
|
22349
22378
|
__pyx_t_1 = 0;
|
|
@@ -22361,17 +22390,17 @@ static PyObject *__pyx_pf_9fontTools_4misc_11bezierTools_74_alignment_transforma
|
|
|
22361
22390
|
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_atan2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1238, __pyx_L1_error)
|
|
22362
22391
|
__Pyx_GOTREF(__pyx_t_4);
|
|
22363
22392
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
22364
|
-
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_end, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1238, __pyx_L1_error)
|
|
22393
|
+
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_end, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1238, __pyx_L1_error)
|
|
22365
22394
|
__Pyx_GOTREF(__pyx_t_3);
|
|
22366
|
-
__pyx_t_5 = __Pyx_GetItemInt(__pyx_v_start, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1238, __pyx_L1_error)
|
|
22395
|
+
__pyx_t_5 = __Pyx_GetItemInt(__pyx_v_start, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1238, __pyx_L1_error)
|
|
22367
22396
|
__Pyx_GOTREF(__pyx_t_5);
|
|
22368
22397
|
__pyx_t_6 = PyNumber_Subtract(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1238, __pyx_L1_error)
|
|
22369
22398
|
__Pyx_GOTREF(__pyx_t_6);
|
|
22370
22399
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
22371
22400
|
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
22372
|
-
__pyx_t_5 = __Pyx_GetItemInt(__pyx_v_end, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1238, __pyx_L1_error)
|
|
22401
|
+
__pyx_t_5 = __Pyx_GetItemInt(__pyx_v_end, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1238, __pyx_L1_error)
|
|
22373
22402
|
__Pyx_GOTREF(__pyx_t_5);
|
|
22374
|
-
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_start, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1238, __pyx_L1_error)
|
|
22403
|
+
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_start, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1238, __pyx_L1_error)
|
|
22375
22404
|
__Pyx_GOTREF(__pyx_t_3);
|
|
22376
22405
|
__pyx_t_7 = PyNumber_Subtract(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1238, __pyx_L1_error)
|
|
22377
22406
|
__Pyx_GOTREF(__pyx_t_7);
|
|
@@ -22441,12 +22470,12 @@ static PyObject *__pyx_pf_9fontTools_4misc_11bezierTools_74_alignment_transforma
|
|
|
22441
22470
|
}
|
|
22442
22471
|
__pyx_t_4 = __pyx_t_7;
|
|
22443
22472
|
__Pyx_INCREF(__pyx_t_4);
|
|
22444
|
-
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_start, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1239, __pyx_L1_error)
|
|
22473
|
+
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_start, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1239, __pyx_L1_error)
|
|
22445
22474
|
__Pyx_GOTREF(__pyx_t_3);
|
|
22446
22475
|
__pyx_t_2 = PyNumber_Negative(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1239, __pyx_L1_error)
|
|
22447
22476
|
__Pyx_GOTREF(__pyx_t_2);
|
|
22448
22477
|
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
22449
|
-
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_start, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1239, __pyx_L1_error)
|
|
22478
|
+
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_start, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1239, __pyx_L1_error)
|
|
22450
22479
|
__Pyx_GOTREF(__pyx_t_3);
|
|
22451
22480
|
__pyx_t_6 = PyNumber_Negative(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1239, __pyx_L1_error)
|
|
22452
22481
|
__Pyx_GOTREF(__pyx_t_6);
|
|
@@ -22934,11 +22963,11 @@ static PyObject *__pyx_pf_9fontTools_4misc_11bezierTools_76_curve_line_intersect
|
|
|
22934
22963
|
__pyx_t_5 = NULL;
|
|
22935
22964
|
__Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_solveQuadratic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1246, __pyx_L1_error)
|
|
22936
22965
|
__Pyx_GOTREF(__pyx_t_1);
|
|
22937
|
-
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_a, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1246, __pyx_L1_error)
|
|
22966
|
+
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_a, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1246, __pyx_L1_error)
|
|
22938
22967
|
__Pyx_GOTREF(__pyx_t_3);
|
|
22939
|
-
__pyx_t_4 = __Pyx_GetItemInt(__pyx_v_b, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1246, __pyx_L1_error)
|
|
22968
|
+
__pyx_t_4 = __Pyx_GetItemInt(__pyx_v_b, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1246, __pyx_L1_error)
|
|
22940
22969
|
__Pyx_GOTREF(__pyx_t_4);
|
|
22941
|
-
__pyx_t_10 = __Pyx_GetItemInt(__pyx_v_c, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1246, __pyx_L1_error)
|
|
22970
|
+
__pyx_t_10 = __Pyx_GetItemInt(__pyx_v_c, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1246, __pyx_L1_error)
|
|
22942
22971
|
__Pyx_GOTREF(__pyx_t_10);
|
|
22943
22972
|
__pyx_t_6 = 1;
|
|
22944
22973
|
#if CYTHON_UNPACK_METHODS
|
|
@@ -23088,13 +23117,13 @@ static PyObject *__pyx_pf_9fontTools_4misc_11bezierTools_76_curve_line_intersect
|
|
|
23088
23117
|
__pyx_t_3 = NULL;
|
|
23089
23118
|
__Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_solveCubic); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1249, __pyx_L1_error)
|
|
23090
23119
|
__Pyx_GOTREF(__pyx_t_4);
|
|
23091
|
-
__pyx_t_2 = __Pyx_GetItemInt(__pyx_v_a, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1249, __pyx_L1_error)
|
|
23120
|
+
__pyx_t_2 = __Pyx_GetItemInt(__pyx_v_a, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1249, __pyx_L1_error)
|
|
23092
23121
|
__Pyx_GOTREF(__pyx_t_2);
|
|
23093
|
-
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_b, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1249, __pyx_L1_error)
|
|
23122
|
+
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_b, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1249, __pyx_L1_error)
|
|
23094
23123
|
__Pyx_GOTREF(__pyx_t_1);
|
|
23095
|
-
__pyx_t_5 = __Pyx_GetItemInt(__pyx_v_c, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1249, __pyx_L1_error)
|
|
23124
|
+
__pyx_t_5 = __Pyx_GetItemInt(__pyx_v_c, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1249, __pyx_L1_error)
|
|
23096
23125
|
__Pyx_GOTREF(__pyx_t_5);
|
|
23097
|
-
__pyx_t_11 = __Pyx_GetItemInt(__pyx_v_d, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1249, __pyx_L1_error)
|
|
23126
|
+
__pyx_t_11 = __Pyx_GetItemInt(__pyx_v_d, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1249, __pyx_L1_error)
|
|
23098
23127
|
__Pyx_GOTREF(__pyx_t_11);
|
|
23099
23128
|
__pyx_t_6 = 1;
|
|
23100
23129
|
#if CYTHON_UNPACK_METHODS
|
|
@@ -23225,7 +23254,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
|
23225
23254
|
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
23226
23255
|
#endif
|
|
23227
23256
|
); /*proto*/
|
|
23228
|
-
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_78curveLineIntersections, "curveLineIntersections(curve, line)\nFinds intersections between a curve and a line.\n\nArgs:\n curve: List of coordinates of the curve segment as 2D tuples.\n line: List of coordinates of the line segment as 2D tuples.\n\nReturns:\n A list of ``Intersection`` objects, each object having ``pt``, ``t1``\n and ``t2`` attributes containing the intersection point, time on first\n segment and time on second segment respectively.\n\nExamples::\n >>> curve = [ (100, 240), (30, 60), (210, 230), (160, 30) ]\n >>> line = [ (25, 260), (230, 20) ]\n >>> intersections = curveLineIntersections(curve, line)\n >>> len(intersections)\n 3\n >>> intersections[0].pt\n (84.9000930760723, 189.87306176459828)");
|
|
23257
|
+
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_78curveLineIntersections, "curveLineIntersections(curve, line)\n\nFinds intersections between a curve and a line.\n\nArgs:\n curve: List of coordinates of the curve segment as 2D tuples.\n line: List of coordinates of the line segment as 2D tuples.\n\nReturns:\n A list of ``Intersection`` objects, each object having ``pt``, ``t1``\n and ``t2`` attributes containing the intersection point, time on first\n segment and time on second segment respectively.\n\nExamples::\n >>> curve = [ (100, 240), (30, 60), (210, 230), (160, 30) ]\n >>> line = [ (25, 260), (230, 20) ]\n >>> intersections = curveLineIntersections(curve, line)\n >>> len(intersections)\n 3\n >>> intersections[0].pt\n (84.9000930760723, 189.87306176459828)");
|
|
23229
23258
|
static PyMethodDef __pyx_mdef_9fontTools_4misc_11bezierTools_79curveLineIntersections = {"curveLineIntersections", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9fontTools_4misc_11bezierTools_79curveLineIntersections, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9fontTools_4misc_11bezierTools_78curveLineIntersections};
|
|
23230
23259
|
static PyObject *__pyx_pw_9fontTools_4misc_11bezierTools_79curveLineIntersections(PyObject *__pyx_self,
|
|
23231
23260
|
#if CYTHON_METH_FASTCALL
|
|
@@ -24605,9 +24634,9 @@ static PyObject *__pyx_pf_9fontTools_4misc_11bezierTools_28_curve_curve_intersec
|
|
|
24605
24634
|
* # If they do overlap but they're tiny, approximate
|
|
24606
24635
|
*/
|
|
24607
24636
|
__Pyx_XDECREF(__pyx_r);
|
|
24608
|
-
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_r, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1330, __pyx_L1_error)
|
|
24637
|
+
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_r, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1330, __pyx_L1_error)
|
|
24609
24638
|
__Pyx_GOTREF(__pyx_t_1);
|
|
24610
|
-
__pyx_t_2 = __Pyx_GetItemInt(__pyx_v_r, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1330, __pyx_L1_error)
|
|
24639
|
+
__pyx_t_2 = __Pyx_GetItemInt(__pyx_v_r, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1330, __pyx_L1_error)
|
|
24611
24640
|
__Pyx_GOTREF(__pyx_t_2);
|
|
24612
24641
|
__pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1330, __pyx_L1_error)
|
|
24613
24642
|
__Pyx_GOTREF(__pyx_t_3);
|
|
@@ -24749,7 +24778,7 @@ static PyObject *__pyx_lambda_funcdef_lambda3(PyObject *__pyx_self, PyObject *__
|
|
|
24749
24778
|
__pyx_outer_scope = (struct __pyx_obj_9fontTools_4misc_11bezierTools___pyx_scope_struct_5__curve_curve_intersections_t *) __Pyx_CyFunction_GetClosure(__pyx_self);
|
|
24750
24779
|
__pyx_cur_scope = __pyx_outer_scope;
|
|
24751
24780
|
__Pyx_XDECREF(__pyx_r);
|
|
24752
|
-
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ts, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1366, __pyx_L1_error)
|
|
24781
|
+
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_ts, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1366, __pyx_L1_error)
|
|
24753
24782
|
__Pyx_GOTREF(__pyx_t_1);
|
|
24754
24783
|
if (unlikely(!__pyx_cur_scope->__pyx_v_precision)) { __Pyx_RaiseClosureNameError("precision"); __PYX_ERR(0, 1366, __pyx_L1_error) }
|
|
24755
24784
|
__pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_cur_scope->__pyx_v_precision); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1366, __pyx_L1_error)
|
|
@@ -24758,7 +24787,7 @@ static PyObject *__pyx_lambda_funcdef_lambda3(PyObject *__pyx_self, PyObject *__
|
|
|
24758
24787
|
__pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1366, __pyx_L1_error)
|
|
24759
24788
|
__Pyx_GOTREF(__pyx_t_1);
|
|
24760
24789
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
24761
|
-
__pyx_t_2 = __Pyx_GetItemInt(__pyx_v_ts, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1366, __pyx_L1_error)
|
|
24790
|
+
__pyx_t_2 = __Pyx_GetItemInt(__pyx_v_ts, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1366, __pyx_L1_error)
|
|
24762
24791
|
__Pyx_GOTREF(__pyx_t_2);
|
|
24763
24792
|
if (unlikely(!__pyx_cur_scope->__pyx_v_precision)) { __Pyx_RaiseClosureNameError("precision"); __PYX_ERR(0, 1366, __pyx_L1_error) }
|
|
24764
24793
|
__pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_cur_scope->__pyx_v_precision); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1366, __pyx_L1_error)
|
|
@@ -25308,7 +25337,7 @@ static PyObject *__pyx_pf_9fontTools_4misc_11bezierTools_84_curve_curve_intersec
|
|
|
25308
25337
|
* c12_range = (midpoint(range1), range1[1])
|
|
25309
25338
|
*
|
|
25310
25339
|
*/
|
|
25311
|
-
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_range1, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1337, __pyx_L1_error)
|
|
25340
|
+
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_range1, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1337, __pyx_L1_error)
|
|
25312
25341
|
__Pyx_GOTREF(__pyx_t_3);
|
|
25313
25342
|
__pyx_t_1 = __pyx_pf_9fontTools_4misc_11bezierTools_28_curve_curve_intersections_t_midpoint(__pyx_v_midpoint, __pyx_v_range1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1337, __pyx_L1_error)
|
|
25314
25343
|
__Pyx_GOTREF(__pyx_t_1);
|
|
@@ -25332,7 +25361,7 @@ static PyObject *__pyx_pf_9fontTools_4misc_11bezierTools_84_curve_curve_intersec
|
|
|
25332
25361
|
*/
|
|
25333
25362
|
__pyx_t_2 = __pyx_pf_9fontTools_4misc_11bezierTools_28_curve_curve_intersections_t_midpoint(__pyx_v_midpoint, __pyx_v_range1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1338, __pyx_L1_error)
|
|
25334
25363
|
__Pyx_GOTREF(__pyx_t_2);
|
|
25335
|
-
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_range1, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1338, __pyx_L1_error)
|
|
25364
|
+
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_range1, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1338, __pyx_L1_error)
|
|
25336
25365
|
__Pyx_GOTREF(__pyx_t_1);
|
|
25337
25366
|
__pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1338, __pyx_L1_error)
|
|
25338
25367
|
__Pyx_GOTREF(__pyx_t_3);
|
|
@@ -25437,7 +25466,7 @@ static PyObject *__pyx_pf_9fontTools_4misc_11bezierTools_84_curve_curve_intersec
|
|
|
25437
25466
|
* c22_range = (midpoint(range2), range2[1])
|
|
25438
25467
|
*
|
|
25439
25468
|
*/
|
|
25440
|
-
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_range2, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1341, __pyx_L1_error)
|
|
25469
|
+
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_range2, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1341, __pyx_L1_error)
|
|
25441
25470
|
__Pyx_GOTREF(__pyx_t_3);
|
|
25442
25471
|
__pyx_t_1 = __pyx_pf_9fontTools_4misc_11bezierTools_28_curve_curve_intersections_t_midpoint(__pyx_v_midpoint, __pyx_v_range2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1341, __pyx_L1_error)
|
|
25443
25472
|
__Pyx_GOTREF(__pyx_t_1);
|
|
@@ -25461,7 +25490,7 @@ static PyObject *__pyx_pf_9fontTools_4misc_11bezierTools_84_curve_curve_intersec
|
|
|
25461
25490
|
*/
|
|
25462
25491
|
__pyx_t_2 = __pyx_pf_9fontTools_4misc_11bezierTools_28_curve_curve_intersections_t_midpoint(__pyx_v_midpoint, __pyx_v_range2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1342, __pyx_L1_error)
|
|
25463
25492
|
__Pyx_GOTREF(__pyx_t_2);
|
|
25464
|
-
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_range2, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1342, __pyx_L1_error)
|
|
25493
|
+
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_range2, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1342, __pyx_L1_error)
|
|
25465
25494
|
__Pyx_GOTREF(__pyx_t_1);
|
|
25466
25495
|
__pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1342, __pyx_L1_error)
|
|
25467
25496
|
__Pyx_GOTREF(__pyx_t_3);
|
|
@@ -26113,7 +26142,7 @@ static PyObject *__pyx_gb_9fontTools_4misc_11bezierTools_12_is_linelike_2generat
|
|
|
26113
26142
|
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_isclose); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1382, __pyx_L1_error)
|
|
26114
26143
|
__Pyx_GOTREF(__pyx_t_7);
|
|
26115
26144
|
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
26116
|
-
__pyx_t_6 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_p, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1382, __pyx_L1_error)
|
|
26145
|
+
__pyx_t_6 = __Pyx_GetItemInt(__pyx_cur_scope->__pyx_v_p, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1382, __pyx_L1_error)
|
|
26117
26146
|
__Pyx_GOTREF(__pyx_t_6);
|
|
26118
26147
|
__pyx_t_8 = 1;
|
|
26119
26148
|
#if CYTHON_UNPACK_METHODS
|
|
@@ -26305,7 +26334,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
|
26305
26334
|
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
26306
26335
|
#endif
|
|
26307
26336
|
); /*proto*/
|
|
26308
|
-
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_88curveCurveIntersections, "curveCurveIntersections(curve1, curve2)\nFinds intersections between a curve and a curve.\n\nArgs:\n curve1: List of coordinates of the first curve segment as 2D tuples.\n curve2: List of coordinates of the second curve segment as 2D tuples.\n\nReturns:\n A list of ``Intersection`` objects, each object having ``pt``, ``t1``\n and ``t2`` attributes containing the intersection point, time on first\n segment and time on second segment respectively.\n\nExamples::\n >>> curve1 = [ (10,100), (90,30), (40,140), (220,220) ]\n >>> curve2 = [ (5,150), (180,20), (80,250), (210,190) ]\n >>> intersections = curveCurveIntersections(curve1, curve2)\n >>> len(intersections)\n 3\n >>> intersections[0].pt\n (81.7831487395506, 109.88904552375288)");
|
|
26337
|
+
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_88curveCurveIntersections, "curveCurveIntersections(curve1, curve2)\n\nFinds intersections between a curve and a curve.\n\nArgs:\n curve1: List of coordinates of the first curve segment as 2D tuples.\n curve2: List of coordinates of the second curve segment as 2D tuples.\n\nReturns:\n A list of ``Intersection`` objects, each object having ``pt``, ``t1``\n and ``t2`` attributes containing the intersection point, time on first\n segment and time on second segment respectively.\n\nExamples::\n >>> curve1 = [ (10,100), (90,30), (40,140), (220,220) ]\n >>> curve2 = [ (5,150), (180,20), (80,250), (210,190) ]\n >>> intersections = curveCurveIntersections(curve1, curve2)\n >>> len(intersections)\n 3\n >>> intersections[0].pt\n (81.7831487395506, 109.88904552375288)");
|
|
26309
26338
|
static PyMethodDef __pyx_mdef_9fontTools_4misc_11bezierTools_89curveCurveIntersections = {"curveCurveIntersections", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9fontTools_4misc_11bezierTools_89curveCurveIntersections, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9fontTools_4misc_11bezierTools_88curveCurveIntersections};
|
|
26310
26339
|
static PyObject *__pyx_pw_9fontTools_4misc_11bezierTools_89curveCurveIntersections(PyObject *__pyx_self,
|
|
26311
26340
|
#if CYTHON_METH_FASTCALL
|
|
@@ -26457,9 +26486,9 @@ static PyObject *__pyx_pf_9fontTools_4misc_11bezierTools_88curveCurveIntersectio
|
|
|
26457
26486
|
* if _is_linelike(curve2):
|
|
26458
26487
|
* line2 = curve2[0], curve2[-1]
|
|
26459
26488
|
*/
|
|
26460
|
-
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curve1, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1407, __pyx_L1_error)
|
|
26489
|
+
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curve1, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1407, __pyx_L1_error)
|
|
26461
26490
|
__Pyx_GOTREF(__pyx_t_1);
|
|
26462
|
-
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_curve1, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1407, __pyx_L1_error)
|
|
26491
|
+
__pyx_t_3 = __Pyx_GetItemInt(__pyx_v_curve1, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1407, __pyx_L1_error)
|
|
26463
26492
|
__Pyx_GOTREF(__pyx_t_3);
|
|
26464
26493
|
__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1407, __pyx_L1_error)
|
|
26465
26494
|
__Pyx_GOTREF(__pyx_t_2);
|
|
@@ -26513,9 +26542,9 @@ static PyObject *__pyx_pf_9fontTools_4misc_11bezierTools_88curveCurveIntersectio
|
|
|
26513
26542
|
* return lineLineIntersections(*line1, *line2)
|
|
26514
26543
|
* else:
|
|
26515
26544
|
*/
|
|
26516
|
-
__pyx_t_2 = __Pyx_GetItemInt(__pyx_v_curve2, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1409, __pyx_L1_error)
|
|
26545
|
+
__pyx_t_2 = __Pyx_GetItemInt(__pyx_v_curve2, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1409, __pyx_L1_error)
|
|
26517
26546
|
__Pyx_GOTREF(__pyx_t_2);
|
|
26518
|
-
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curve2, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1409, __pyx_L1_error)
|
|
26547
|
+
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curve2, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1409, __pyx_L1_error)
|
|
26519
26548
|
__Pyx_GOTREF(__pyx_t_1);
|
|
26520
26549
|
__pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1409, __pyx_L1_error)
|
|
26521
26550
|
__Pyx_GOTREF(__pyx_t_3);
|
|
@@ -26644,9 +26673,9 @@ static PyObject *__pyx_pf_9fontTools_4misc_11bezierTools_88curveCurveIntersectio
|
|
|
26644
26673
|
* return curveLineIntersections(curve1, line2)
|
|
26645
26674
|
*
|
|
26646
26675
|
*/
|
|
26647
|
-
__pyx_t_2 = __Pyx_GetItemInt(__pyx_v_curve2, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1414, __pyx_L1_error)
|
|
26676
|
+
__pyx_t_2 = __Pyx_GetItemInt(__pyx_v_curve2, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1414, __pyx_L1_error)
|
|
26648
26677
|
__Pyx_GOTREF(__pyx_t_2);
|
|
26649
|
-
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curve2, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1414, __pyx_L1_error)
|
|
26678
|
+
__pyx_t_1 = __Pyx_GetItemInt(__pyx_v_curve2, -1L, long, 1, __Pyx_PyLong_From_long, 0, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1414, __pyx_L1_error)
|
|
26650
26679
|
__Pyx_GOTREF(__pyx_t_1);
|
|
26651
26680
|
__pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1414, __pyx_L1_error)
|
|
26652
26681
|
__Pyx_GOTREF(__pyx_t_3);
|
|
@@ -26820,7 +26849,7 @@ static PyObject *__pyx_pf_9fontTools_4misc_11bezierTools_88curveCurveIntersectio
|
|
|
26820
26849
|
__pyx_t_11 = NULL;
|
|
26821
26850
|
__Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_segmentPointAtT); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1419, __pyx_L7_error)
|
|
26822
26851
|
__Pyx_GOTREF(__pyx_t_12);
|
|
26823
|
-
__pyx_t_13 = __Pyx_GetItemInt(__pyx_8genexpr8__pyx_v_ts, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1419, __pyx_L7_error)
|
|
26852
|
+
__pyx_t_13 = __Pyx_GetItemInt(__pyx_8genexpr8__pyx_v_ts, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1419, __pyx_L7_error)
|
|
26824
26853
|
__Pyx_GOTREF(__pyx_t_13);
|
|
26825
26854
|
__pyx_t_4 = 1;
|
|
26826
26855
|
#if CYTHON_UNPACK_METHODS
|
|
@@ -26843,9 +26872,9 @@ static PyObject *__pyx_pf_9fontTools_4misc_11bezierTools_88curveCurveIntersectio
|
|
|
26843
26872
|
if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1419, __pyx_L7_error)
|
|
26844
26873
|
__Pyx_GOTREF(__pyx_t_10);
|
|
26845
26874
|
}
|
|
26846
|
-
__pyx_t_12 = __Pyx_GetItemInt(__pyx_8genexpr8__pyx_v_ts, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1419, __pyx_L7_error)
|
|
26875
|
+
__pyx_t_12 = __Pyx_GetItemInt(__pyx_8genexpr8__pyx_v_ts, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1419, __pyx_L7_error)
|
|
26847
26876
|
__Pyx_GOTREF(__pyx_t_12);
|
|
26848
|
-
__pyx_t_13 = __Pyx_GetItemInt(__pyx_8genexpr8__pyx_v_ts, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1419, __pyx_L7_error)
|
|
26877
|
+
__pyx_t_13 = __Pyx_GetItemInt(__pyx_8genexpr8__pyx_v_ts, 1, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1419, __pyx_L7_error)
|
|
26849
26878
|
__Pyx_GOTREF(__pyx_t_13);
|
|
26850
26879
|
__pyx_t_4 = 1;
|
|
26851
26880
|
#if CYTHON_UNPACK_METHODS
|
|
@@ -26946,7 +26975,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
|
26946
26975
|
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
26947
26976
|
#endif
|
|
26948
26977
|
); /*proto*/
|
|
26949
|
-
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_90segmentSegmentIntersections, "segmentSegmentIntersections(seg1, seg2)\nFinds intersections between two segments.\n\nArgs:\n seg1: List of coordinates of the first segment as 2D tuples.\n seg2: List of coordinates of the second segment as 2D tuples.\n\nReturns:\n A list of ``Intersection`` objects, each object having ``pt``, ``t1``\n and ``t2`` attributes containing the intersection point, time on first\n segment and time on second segment respectively.\n\nExamples::\n >>> curve1 = [ (10,100), (90,30), (40,140), (220,220) ]\n >>> curve2 = [ (5,150), (180,20), (80,250), (210,190) ]\n >>> intersections = segmentSegmentIntersections(curve1, curve2)\n >>> len(intersections)\n 3\n >>> intersections[0].pt\n (81.7831487395506, 109.88904552375288)\n >>> curve3 = [ (100, 240), (30, 60), (210, 230), (160, 30) ]\n >>> line = [ (25, 260), (230, 20) ]\n >>> intersections = segmentSegmentIntersections(curve3, line)\n >>> len(intersections)\n 3\n >>> intersections[0].pt\n (84.9000930760723, 189.87306176459828)");
|
|
26978
|
+
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_90segmentSegmentIntersections, "segmentSegmentIntersections(seg1, seg2)\n\nFinds intersections between two segments.\n\nArgs:\n seg1: List of coordinates of the first segment as 2D tuples.\n seg2: List of coordinates of the second segment as 2D tuples.\n\nReturns:\n A list of ``Intersection`` objects, each object having ``pt``, ``t1``\n and ``t2`` attributes containing the intersection point, time on first\n segment and time on second segment respectively.\n\nExamples::\n >>> curve1 = [ (10,100), (90,30), (40,140), (220,220) ]\n >>> curve2 = [ (5,150), (180,20), (80,250), (210,190) ]\n >>> intersections = segmentSegmentIntersections(curve1, curve2)\n >>> len(intersections)\n 3\n >>> intersections[0].pt\n (81.7831487395506, 109.88904552375288)\n >>> curve3 = [ (100, 240), (30, 60), (210, 230), (160, 30) ]\n >>> line = [ (25, 260), (230, 20) ]\n >>> intersections = segmentSegmentIntersections(curve3, line)\n >>> len(intersections)\n 3\n >>> intersections[0].pt\n (84.9000930760723, 189.87306176459828)");
|
|
26950
26979
|
static PyMethodDef __pyx_mdef_9fontTools_4misc_11bezierTools_91segmentSegmentIntersections = {"segmentSegmentIntersections", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9fontTools_4misc_11bezierTools_91segmentSegmentIntersections, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9fontTools_4misc_11bezierTools_90segmentSegmentIntersections};
|
|
26951
26980
|
static PyObject *__pyx_pw_9fontTools_4misc_11bezierTools_91segmentSegmentIntersections(PyObject *__pyx_self,
|
|
26952
26981
|
#if CYTHON_METH_FASTCALL
|
|
@@ -27499,7 +27528,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
|
27499
27528
|
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
27500
27529
|
#endif
|
|
27501
27530
|
); /*proto*/
|
|
27502
|
-
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_92_segmentrepr, "_segmentrepr(obj)\n>>> _segmentrepr([1, [2, 3], [], [[2, [3, 4], [0.1, 2.2]]]])\n'(1, (2, 3), (), ((2, (3, 4), (0.1, 2.2))))'");
|
|
27531
|
+
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_92_segmentrepr, "_segmentrepr(obj)\n\n>>> _segmentrepr([1, [2, 3], [], [[2, [3, 4], [0.1, 2.2]]]])\n'(1, (2, 3), (), ((2, (3, 4), (0.1, 2.2))))'");
|
|
27503
27532
|
static PyMethodDef __pyx_mdef_9fontTools_4misc_11bezierTools_93_segmentrepr = {"_segmentrepr", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9fontTools_4misc_11bezierTools_93_segmentrepr, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9fontTools_4misc_11bezierTools_92_segmentrepr};
|
|
27504
27533
|
static PyObject *__pyx_pw_9fontTools_4misc_11bezierTools_93_segmentrepr(PyObject *__pyx_self,
|
|
27505
27534
|
#if CYTHON_METH_FASTCALL
|
|
@@ -27939,7 +27968,7 @@ PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
|
|
27939
27968
|
PyObject *__pyx_args, PyObject *__pyx_kwds
|
|
27940
27969
|
#endif
|
|
27941
27970
|
); /*proto*/
|
|
27942
|
-
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_94printSegments, "printSegments(segments)\nHelper for the doctests, displaying each segment in a list of\nsegments on a single line as a tuple.");
|
|
27971
|
+
PyDoc_STRVAR(__pyx_doc_9fontTools_4misc_11bezierTools_94printSegments, "printSegments(segments)\n\nHelper for the doctests, displaying each segment in a list of\nsegments on a single line as a tuple.");
|
|
27943
27972
|
static PyMethodDef __pyx_mdef_9fontTools_4misc_11bezierTools_95printSegments = {"printSegments", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9fontTools_4misc_11bezierTools_95printSegments, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9fontTools_4misc_11bezierTools_94printSegments};
|
|
27944
27973
|
static PyObject *__pyx_pw_9fontTools_4misc_11bezierTools_95printSegments(PyObject *__pyx_self,
|
|
27945
27974
|
#if CYTHON_METH_FASTCALL
|
|
@@ -30106,6 +30135,13 @@ __Pyx_RefNannySetupContext("PyInit_bezierTools", 0);
|
|
|
30106
30135
|
__pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
30107
30136
|
__pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
30108
30137
|
__pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
30138
|
+
/*--- Initialize various global constants etc. ---*/
|
|
30139
|
+
if (__Pyx_InitConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
30140
|
+
stringtab_initialized = 1;
|
|
30141
|
+
if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
30142
|
+
#if 0 || defined(__Pyx_CyFunction_USED) || defined(__Pyx_FusedFunction_USED) || defined(__Pyx_Coroutine_USED) || defined(__Pyx_Generator_USED) || defined(__Pyx_AsyncGen_USED)
|
|
30143
|
+
if (__pyx_CommonTypesMetaclass_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
30144
|
+
#endif
|
|
30109
30145
|
#ifdef __Pyx_CyFunction_USED
|
|
30110
30146
|
if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
30111
30147
|
#endif
|
|
@@ -30122,10 +30158,6 @@ __Pyx_RefNannySetupContext("PyInit_bezierTools", 0);
|
|
|
30122
30158
|
if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
30123
30159
|
#endif
|
|
30124
30160
|
/*--- Library function declarations ---*/
|
|
30125
|
-
/*--- Initialize various global constants etc. ---*/
|
|
30126
|
-
if (__Pyx_InitConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
30127
|
-
stringtab_initialized = 1;
|
|
30128
|
-
if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
30129
30161
|
if (__pyx_module_is_main_fontTools__misc__bezierTools) {
|
|
30130
30162
|
if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
30131
30163
|
}
|
|
@@ -31377,6 +31409,7 @@ static const __Pyx_StringTabEntry __pyx_string_tab[] = {
|
|
|
31377
31409
|
{__pyx_k_segmentrepr_locals_genexpr, sizeof(__pyx_k_segmentrepr_locals_genexpr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_segmentrepr_locals_genexpr */
|
|
31378
31410
|
{__pyx_k_segments, sizeof(__pyx_k_segments), 0, 1, 1}, /* PyObject cname: __pyx_n_u_segments */
|
|
31379
31411
|
{__pyx_k_send, sizeof(__pyx_k_send), 0, 1, 1}, /* PyObject cname: __pyx_n_u_send */
|
|
31412
|
+
{__pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_name */
|
|
31380
31413
|
{__pyx_k_slope12, sizeof(__pyx_k_slope12), 0, 1, 1}, /* PyObject cname: __pyx_n_u_slope12 */
|
|
31381
31414
|
{__pyx_k_slope34, sizeof(__pyx_k_slope34), 0, 1, 1}, /* PyObject cname: __pyx_n_u_slope34 */
|
|
31382
31415
|
{__pyx_k_solutions, sizeof(__pyx_k_solutions), 0, 1, 1}, /* PyObject cname: __pyx_n_u_solutions */
|
|
@@ -34001,24 +34034,83 @@ __Pyx_Coroutine_Set_Owned_Yield_From(__pyx_CoroutineObject *gen, PyObject *yf) {
|
|
|
34001
34034
|
gen->yieldfrom = yf;
|
|
34002
34035
|
}
|
|
34003
34036
|
|
|
34037
|
+
/* LimitedApiGetTypeDict */
|
|
34038
|
+
#if CYTHON_COMPILING_IN_LIMITED_API
|
|
34039
|
+
static Py_ssize_t __Pyx_GetTypeDictOffset(void) {
|
|
34040
|
+
PyObject *tp_dictoffset_o;
|
|
34041
|
+
Py_ssize_t tp_dictoffset;
|
|
34042
|
+
tp_dictoffset_o = PyObject_GetAttrString((PyObject*)(&PyType_Type), "__dictoffset__");
|
|
34043
|
+
if (unlikely(!tp_dictoffset_o)) return -1;
|
|
34044
|
+
tp_dictoffset = PyLong_AsSsize_t(tp_dictoffset_o);
|
|
34045
|
+
Py_DECREF(tp_dictoffset_o);
|
|
34046
|
+
if (unlikely(tp_dictoffset == 0)) {
|
|
34047
|
+
PyErr_SetString(
|
|
34048
|
+
PyExc_TypeError,
|
|
34049
|
+
"'type' doesn't have a dictoffset");
|
|
34050
|
+
return -1;
|
|
34051
|
+
} else if (unlikely(tp_dictoffset < 0)) {
|
|
34052
|
+
PyErr_SetString(
|
|
34053
|
+
PyExc_TypeError,
|
|
34054
|
+
"'type' has an unexpected negative dictoffset. "
|
|
34055
|
+
"Please report this as Cython bug");
|
|
34056
|
+
return -1;
|
|
34057
|
+
}
|
|
34058
|
+
return tp_dictoffset;
|
|
34059
|
+
}
|
|
34060
|
+
static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp) {
|
|
34061
|
+
static Py_ssize_t tp_dictoffset = 0;
|
|
34062
|
+
if (unlikely(tp_dictoffset == 0)) {
|
|
34063
|
+
tp_dictoffset = __Pyx_GetTypeDictOffset();
|
|
34064
|
+
if (unlikely(tp_dictoffset == -1 && PyErr_Occurred())) {
|
|
34065
|
+
tp_dictoffset = 0; // try again next time?
|
|
34066
|
+
return NULL;
|
|
34067
|
+
}
|
|
34068
|
+
}
|
|
34069
|
+
return *(PyObject**)((char*)tp + tp_dictoffset);
|
|
34070
|
+
}
|
|
34071
|
+
#endif
|
|
34072
|
+
|
|
34073
|
+
/* SetItemOnTypeDict */
|
|
34074
|
+
static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v) {
|
|
34075
|
+
int result;
|
|
34076
|
+
PyObject *tp_dict;
|
|
34077
|
+
#if CYTHON_COMPILING_IN_LIMITED_API
|
|
34078
|
+
tp_dict = __Pyx_GetTypeDict(tp);
|
|
34079
|
+
if (unlikely(!tp_dict)) return -1;
|
|
34080
|
+
#else
|
|
34081
|
+
tp_dict = tp->tp_dict;
|
|
34082
|
+
#endif
|
|
34083
|
+
result = PyDict_SetItem(tp_dict, k, v);
|
|
34084
|
+
if (likely(!result)) {
|
|
34085
|
+
PyType_Modified(tp);
|
|
34086
|
+
if (unlikely(PyObject_HasAttr(v, __pyx_mstate_global->__pyx_n_u_set_name))) {
|
|
34087
|
+
PyObject *setNameResult = PyObject_CallMethodObjArgs(v, __pyx_mstate_global->__pyx_n_u_set_name, (PyObject *) tp, k, NULL);
|
|
34088
|
+
if (!setNameResult) return -1;
|
|
34089
|
+
Py_DECREF(setNameResult);
|
|
34090
|
+
}
|
|
34091
|
+
}
|
|
34092
|
+
return result;
|
|
34093
|
+
}
|
|
34094
|
+
|
|
34004
34095
|
/* FixUpExtensionType */
|
|
34005
34096
|
static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) {
|
|
34006
|
-
#if
|
|
34097
|
+
#if __PYX_LIMITED_VERSION_HEX > 0x030900B1
|
|
34007
34098
|
CYTHON_UNUSED_VAR(spec);
|
|
34008
34099
|
CYTHON_UNUSED_VAR(type);
|
|
34100
|
+
CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict);
|
|
34009
34101
|
#else
|
|
34010
34102
|
const PyType_Slot *slot = spec->slots;
|
|
34103
|
+
int changed = 0;
|
|
34104
|
+
#if !CYTHON_COMPILING_IN_LIMITED_API
|
|
34011
34105
|
while (slot && slot->slot && slot->slot != Py_tp_members)
|
|
34012
34106
|
slot++;
|
|
34013
34107
|
if (slot && slot->slot == Py_tp_members) {
|
|
34014
|
-
|
|
34015
|
-
#if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON)
|
|
34108
|
+
#if !CYTHON_COMPILING_IN_CPYTHON
|
|
34016
34109
|
const
|
|
34017
|
-
#endif
|
|
34110
|
+
#endif // !CYTHON_COMPILING_IN_CPYTHON)
|
|
34018
34111
|
PyMemberDef *memb = (PyMemberDef*) slot->pfunc;
|
|
34019
34112
|
while (memb && memb->name) {
|
|
34020
34113
|
if (memb->name[0] == '_' && memb->name[1] == '_') {
|
|
34021
|
-
#if PY_VERSION_HEX < 0x030900b1
|
|
34022
34114
|
if (strcmp(memb->name, "__weaklistoffset__") == 0) {
|
|
34023
34115
|
assert(memb->type == T_PYSSIZET);
|
|
34024
34116
|
assert(memb->flags == READONLY);
|
|
@@ -34042,11 +34134,7 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject
|
|
|
34042
34134
|
#endif
|
|
34043
34135
|
changed = 1;
|
|
34044
34136
|
}
|
|
34045
|
-
#endif
|
|
34046
|
-
#else
|
|
34047
|
-
if ((0));
|
|
34048
|
-
#endif
|
|
34049
|
-
#if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON
|
|
34137
|
+
#endif // CYTHON_METH_FASTCALL
|
|
34050
34138
|
else if (strcmp(memb->name, "__module__") == 0) {
|
|
34051
34139
|
PyObject *descr;
|
|
34052
34140
|
assert(memb->type == T_OBJECT);
|
|
@@ -34054,21 +34142,52 @@ static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject
|
|
|
34054
34142
|
descr = PyDescr_NewMember(type, memb);
|
|
34055
34143
|
if (unlikely(!descr))
|
|
34056
34144
|
return -1;
|
|
34057
|
-
|
|
34058
|
-
|
|
34145
|
+
int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr);
|
|
34146
|
+
Py_DECREF(descr);
|
|
34147
|
+
if (unlikely(set_item_result < 0)) {
|
|
34059
34148
|
return -1;
|
|
34060
34149
|
}
|
|
34061
|
-
Py_DECREF(descr);
|
|
34062
34150
|
changed = 1;
|
|
34063
34151
|
}
|
|
34064
|
-
#endif
|
|
34065
34152
|
}
|
|
34066
34153
|
memb++;
|
|
34067
34154
|
}
|
|
34068
|
-
if (changed)
|
|
34069
|
-
PyType_Modified(type);
|
|
34070
34155
|
}
|
|
34071
|
-
#endif
|
|
34156
|
+
#endif // !CYTHON_COMPILING_IN_LIMITED_API
|
|
34157
|
+
slot = spec->slots;
|
|
34158
|
+
while (slot && slot->slot && slot->slot != Py_tp_getset)
|
|
34159
|
+
slot++;
|
|
34160
|
+
if (slot && slot->slot == Py_tp_getset) {
|
|
34161
|
+
PyGetSetDef *getset = (PyGetSetDef*) slot->pfunc;
|
|
34162
|
+
while (getset && getset->name) {
|
|
34163
|
+
if (getset->name[0] == '_' && getset->name[1] == '_' && strcmp(getset->name, "__module__") == 0) {
|
|
34164
|
+
PyObject *descr = PyDescr_NewGetSet(type, getset);
|
|
34165
|
+
if (unlikely(!descr))
|
|
34166
|
+
return -1;
|
|
34167
|
+
#if CYTHON_COMPILING_IN_LIMITED_API
|
|
34168
|
+
PyObject *pyname = PyUnicode_FromString(getset->name);
|
|
34169
|
+
if (unlikely(!pyname)) {
|
|
34170
|
+
Py_DECREF(descr);
|
|
34171
|
+
return -1;
|
|
34172
|
+
}
|
|
34173
|
+
int set_item_result = __Pyx_SetItemOnTypeDict(type, pyname, descr);
|
|
34174
|
+
Py_DECREF(pyname);
|
|
34175
|
+
#else
|
|
34176
|
+
CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict);
|
|
34177
|
+
int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr);
|
|
34178
|
+
#endif
|
|
34179
|
+
Py_DECREF(descr);
|
|
34180
|
+
if (unlikely(set_item_result < 0)) {
|
|
34181
|
+
return -1;
|
|
34182
|
+
}
|
|
34183
|
+
changed = 1;
|
|
34184
|
+
}
|
|
34185
|
+
++getset;
|
|
34186
|
+
}
|
|
34187
|
+
}
|
|
34188
|
+
if (changed)
|
|
34189
|
+
PyType_Modified(type);
|
|
34190
|
+
#endif // PY_VERSION_HEX > 0x030900B1
|
|
34072
34191
|
return 0;
|
|
34073
34192
|
}
|
|
34074
34193
|
|
|
@@ -34095,6 +34214,24 @@ static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *ke
|
|
|
34095
34214
|
}
|
|
34096
34215
|
|
|
34097
34216
|
/* FetchCommonType */
|
|
34217
|
+
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
|
|
34218
|
+
static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
|
|
34219
|
+
PyObject *result = __Pyx_PyType_FromModuleAndSpec(module, spec, bases);
|
|
34220
|
+
if (result && metaclass) {
|
|
34221
|
+
PyObject *old_tp = (PyObject*)Py_TYPE(result);
|
|
34222
|
+
Py_INCREF((PyObject*)metaclass);
|
|
34223
|
+
#if __PYX_LIMITED_VERSION_HEX >= 0x03090000
|
|
34224
|
+
Py_SET_TYPE(result, metaclass);
|
|
34225
|
+
#else
|
|
34226
|
+
result->ob_type = metaclass;
|
|
34227
|
+
#endif
|
|
34228
|
+
Py_DECREF(old_tp);
|
|
34229
|
+
}
|
|
34230
|
+
return result;
|
|
34231
|
+
}
|
|
34232
|
+
#else
|
|
34233
|
+
#define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b)
|
|
34234
|
+
#endif
|
|
34098
34235
|
static int __Pyx_VerifyCachedType(PyObject *cached_type,
|
|
34099
34236
|
const char *name,
|
|
34100
34237
|
Py_ssize_t expected_basicsize) {
|
|
@@ -34104,6 +34241,9 @@ static int __Pyx_VerifyCachedType(PyObject *cached_type,
|
|
|
34104
34241
|
"Shared Cython type %.200s is not a type object", name);
|
|
34105
34242
|
return -1;
|
|
34106
34243
|
}
|
|
34244
|
+
if (expected_basicsize == 0) {
|
|
34245
|
+
return 0; // size is inherited, nothing useful to check
|
|
34246
|
+
}
|
|
34107
34247
|
#if CYTHON_COMPILING_IN_LIMITED_API
|
|
34108
34248
|
PyObject *py_basicsize;
|
|
34109
34249
|
py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
|
|
@@ -34123,7 +34263,7 @@ static int __Pyx_VerifyCachedType(PyObject *cached_type,
|
|
|
34123
34263
|
}
|
|
34124
34264
|
return 0;
|
|
34125
34265
|
}
|
|
34126
|
-
static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) {
|
|
34266
|
+
static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
|
|
34127
34267
|
PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name;
|
|
34128
34268
|
int get_item_ref_result;
|
|
34129
34269
|
const char* object_name = strrchr(spec->name, '.');
|
|
@@ -34147,7 +34287,7 @@ static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec
|
|
|
34147
34287
|
goto bad;
|
|
34148
34288
|
}
|
|
34149
34289
|
CYTHON_UNUSED_VAR(module);
|
|
34150
|
-
cached_type =
|
|
34290
|
+
cached_type = __Pyx_PyType_FromMetaclass(metaclass, abi_module, spec, bases);
|
|
34151
34291
|
if (unlikely(!cached_type)) goto bad;
|
|
34152
34292
|
if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad;
|
|
34153
34293
|
new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type, 1);
|
|
@@ -34176,6 +34316,42 @@ bad:
|
|
|
34176
34316
|
goto done;
|
|
34177
34317
|
}
|
|
34178
34318
|
|
|
34319
|
+
/* CommonTypesMetaclass */
|
|
34320
|
+
PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
|
|
34321
|
+
return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
|
|
34322
|
+
}
|
|
34323
|
+
static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
|
|
34324
|
+
{"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL},
|
|
34325
|
+
{0, 0, 0, 0, 0}
|
|
34326
|
+
};
|
|
34327
|
+
static PyType_Slot __pyx_CommonTypesMetaclass_slots[] = {
|
|
34328
|
+
{Py_tp_getset, (void *)__pyx_CommonTypesMetaclass_getset},
|
|
34329
|
+
{0, 0}
|
|
34330
|
+
};
|
|
34331
|
+
static PyType_Spec __pyx_CommonTypesMetaclass_spec = {
|
|
34332
|
+
__PYX_TYPE_MODULE_PREFIX "_common_types_metatype",
|
|
34333
|
+
0,
|
|
34334
|
+
0,
|
|
34335
|
+
#if PY_VERSION_HEX >= 0x030A0000
|
|
34336
|
+
Py_TPFLAGS_IMMUTABLETYPE |
|
|
34337
|
+
Py_TPFLAGS_DISALLOW_INSTANTIATION |
|
|
34338
|
+
#endif
|
|
34339
|
+
Py_TPFLAGS_DEFAULT,
|
|
34340
|
+
__pyx_CommonTypesMetaclass_slots
|
|
34341
|
+
};
|
|
34342
|
+
static int __pyx_CommonTypesMetaclass_init(PyObject *module) {
|
|
34343
|
+
__pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
|
|
34344
|
+
PyObject *bases = PyTuple_Pack(1, &PyType_Type);
|
|
34345
|
+
if (unlikely(!bases)) {
|
|
34346
|
+
return -1;
|
|
34347
|
+
}
|
|
34348
|
+
mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases);
|
|
34349
|
+
if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) {
|
|
34350
|
+
return -1;
|
|
34351
|
+
}
|
|
34352
|
+
return 0;
|
|
34353
|
+
}
|
|
34354
|
+
|
|
34179
34355
|
/* RaiseException */
|
|
34180
34356
|
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
|
|
34181
34357
|
PyObject* owned_instance = NULL;
|
|
@@ -35593,6 +35769,14 @@ static void __Pyx_SetBackportTypeAmSend(PyTypeObject *type, __Pyx_PyAsyncMethods
|
|
|
35593
35769
|
type->tp_as_async = __Pyx_SlotTpAsAsync(static_amsend_methods);
|
|
35594
35770
|
}
|
|
35595
35771
|
#endif
|
|
35772
|
+
static PyObject *__Pyx_Coroutine_fail_reduce_ex(PyObject *self, PyObject *arg) {
|
|
35773
|
+
CYTHON_UNUSED_VAR(arg);
|
|
35774
|
+
__Pyx_TypeName self_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE((PyObject*)self));
|
|
35775
|
+
PyErr_Format(PyExc_TypeError, "cannot pickle '" __Pyx_FMT_TYPENAME "' object",
|
|
35776
|
+
self_type_name);
|
|
35777
|
+
__Pyx_DECREF_TypeName(self_type_name);
|
|
35778
|
+
return NULL;
|
|
35779
|
+
}
|
|
35596
35780
|
|
|
35597
35781
|
/* Generator */
|
|
35598
35782
|
static PyMethodDef __pyx_Generator_methods[] = {
|
|
@@ -35602,6 +35786,8 @@ static PyMethodDef __pyx_Generator_methods[] = {
|
|
|
35602
35786
|
PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
|
|
35603
35787
|
{"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
|
|
35604
35788
|
PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
|
|
35789
|
+
{"__reduce_ex__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_O, 0},
|
|
35790
|
+
{"__reduce__", (PyCFunction) __Pyx_Coroutine_fail_reduce_ex, METH_NOARGS, 0},
|
|
35605
35791
|
{0, 0, 0, 0}
|
|
35606
35792
|
};
|
|
35607
35793
|
static PyMemberDef __pyx_Generator_memberlist[] = {
|
|
@@ -35654,7 +35840,8 @@ static __Pyx_PyAsyncMethodsStruct __pyx_Generator_as_async;
|
|
|
35654
35840
|
#endif
|
|
35655
35841
|
static int __pyx_Generator_init(PyObject *module) {
|
|
35656
35842
|
__pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
|
|
35657
|
-
mstate->__pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(
|
|
35843
|
+
mstate->__pyx_GeneratorType = __Pyx_FetchCommonTypeFromSpec(
|
|
35844
|
+
mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_GeneratorType_spec, NULL);
|
|
35658
35845
|
if (unlikely(!mstate->__pyx_GeneratorType)) {
|
|
35659
35846
|
return -1;
|
|
35660
35847
|
}
|
|
@@ -37476,7 +37663,8 @@ static PyType_Spec __pyx_CyFunctionType_spec = {
|
|
|
37476
37663
|
};
|
|
37477
37664
|
static int __pyx_CyFunction_init(PyObject *module) {
|
|
37478
37665
|
__pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
|
|
37479
|
-
mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(
|
|
37666
|
+
mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(
|
|
37667
|
+
mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CyFunctionType_spec, NULL);
|
|
37480
37668
|
if (unlikely(mstate->__pyx_CyFunctionType == NULL)) {
|
|
37481
37669
|
return -1;
|
|
37482
37670
|
}
|