Out[27]:

Generated by Cython 0.19.1 on Fri Aug 16 16:37:23 2013

1:

2: import numpy as np

/* "_cython_magic_637c713b986c525e98b048fef3dc5c09.pyx":2 * * import numpy as np # < < < < < < < < < < < < < < * cimport numpy as np * cimport cython */ __pyx_t_1 = __Pyx_Import (((PyObject *)__pyx_n_s__numpy), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_1); if ( PyDict_SetItem (__pyx_d, __pyx_n_s__np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF (__pyx_t_1); __pyx_t_1 = 0; /* "_cython_magic_637c713b986c525e98b048fef3dc5c09.pyx":25 * * * cpdef cy_compute_normal(np.ndarray[np.float64_t, ndim=2] vertex, np.ndarray[int, ndim=2] face): # < < < < < < < < < < < < < < * cdef int nface = face.shape[0] * cdef int nvert = vertex.shape[0] */ __pyx_t_1 = PyDict_New (); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (((PyObject *)__pyx_t_1)); if ( PyDict_SetItem (__pyx_d, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF (((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

3: cimport numpy as np

4: cimport cython

5:

6:

7: cdef np.ndarray[np.float64_t, ndim=2] normalise(np.ndarray[np.float64_t, ndim=2] vec):

/* "_cython_magic_637c713b986c525e98b048fef3dc5c09.pyx":7 * * * cdef np.ndarray[np.float64_t, ndim=2] normalise(np.ndarray[np.float64_t, ndim=2] vec): # < < < < < < < < < < < < < < * # Avoid divisions by almost 0 numbers * cdef np.ndarray[np.float64_t, ndim=1] d = np.sqrt(np.sum(vec ** 2, axis=1)) */ static PyArrayObject *__pyx_f_46_cython_magic_637c713b986c525e98b048fef3dc5c09_normalise(PyArrayObject *__pyx_v_vec) { PyArrayObject *__pyx_v_d = 0; __Pyx_LocalBuf_ND __pyx_pybuffernd_d; __Pyx_Buffer __pyx_pybuffer_d; __Pyx_LocalBuf_ND __pyx_pybuffernd_vec; __Pyx_Buffer __pyx_pybuffer_vec; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext ("normalise", 0); __pyx_pybuffer_d.pybuffer.buf = NULL; __pyx_pybuffer_d.refcount = 0; __pyx_pybuffernd_d.data = NULL; __pyx_pybuffernd_d.rcbuffer = &__pyx_pybuffer_d; __pyx_pybuffer_vec.pybuffer.buf = NULL; __pyx_pybuffer_vec.refcount = 0; __pyx_pybuffernd_vec.data = NULL; __pyx_pybuffernd_vec.rcbuffer = &__pyx_pybuffer_vec; { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely( __Pyx_GetBufferAndValidate (&__pyx_pybuffernd_vec.rcbuffer->pybuffer, (PyObject*)__pyx_v_vec, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_vec.diminfo[0].strides = __pyx_pybuffernd_vec.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vec.diminfo[0].shape = __pyx_pybuffernd_vec.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_vec.diminfo[1].strides = __pyx_pybuffernd_vec.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_vec.diminfo[1].shape = __pyx_pybuffernd_vec.rcbuffer->pybuffer.shape[1];

8: # Avoid divisions by almost 0 numbers

9: cdef np.ndarray[np.float64_t, ndim=1] d = np.sqrt(np.sum(vec ** 2, axis=1))

/* "_cython_magic_637c713b986c525e98b048fef3dc5c09.pyx":9 * cdef np.ndarray[np.float64_t, ndim=2] normalise(np.ndarray[np.float64_t, ndim=2] vec): * # Avoid divisions by almost 0 numbers * cdef np.ndarray[np.float64_t, ndim=1] d = np.sqrt(np.sum(vec ** 2, axis=1)) # < < < < < < < < < < < < < < * d[d < np.spacing(1)] = 1.0 * return vec / d[..., None] */ __pyx_t_1 = __Pyx_GetModuleGlobalName (__pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_1); __pyx_t_2 = __Pyx_ PyObject_GetAttrStr (__pyx_t_1, __pyx_n_s__sqrt); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_2); __Pyx_DECREF (__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __Pyx_GetModuleGlobalName (__pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_1); __pyx_t_3 = __Pyx_ PyObject_GetAttrStr (__pyx_t_1, __pyx_n_s__sum); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_3); __Pyx_DECREF (__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyNumber_Power (((PyObject *)__pyx_v_vec), __pyx_int_2, Py_None); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_1); __pyx_t_4 = PyTuple_New (1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_4); PyTuple_SET_ITEM (__pyx_t_4, 0, __pyx_t_1); __Pyx_GIVEREF (__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyDict_New (); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (((PyObject *)__pyx_t_1)); if ( PyDict_SetItem (__pyx_t_1, ((PyObject *)__pyx_n_s__axis), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_5 = PyObject_Call (__pyx_t_3, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_5); __Pyx_DECREF (__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF (((PyObject *)__pyx_t_4)); __pyx_t_4 = 0; __Pyx_DECREF (((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New (1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_1); PyTuple_SET_ITEM (__pyx_t_1, 0, __pyx_t_5); __Pyx_GIVEREF (__pyx_t_5); __pyx_t_5 = 0; __pyx_t_5 = PyObject_Call (__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_5); __Pyx_DECREF (__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF (((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; if (!(likely(((__pyx_t_5) == Py_None) || likely( __Pyx_TypeTest (__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_6 = ((PyArrayObject *)__pyx_t_5); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely( __Pyx_GetBufferAndValidate (&__pyx_pybuffernd_d.rcbuffer->pybuffer, (PyObject*)__pyx_t_6, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_d = ((PyArrayObject *)Py_None); __Pyx_INCREF (Py_None); __pyx_pybuffernd_d.rcbuffer->pybuffer.buf = NULL; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_pybuffernd_d.diminfo[0].strides = __pyx_pybuffernd_d.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_d.diminfo[0].shape = __pyx_pybuffernd_d.rcbuffer->pybuffer.shape[0]; } } __pyx_t_6 = 0; __pyx_v_d = ((PyArrayObject *)__pyx_t_5); __pyx_t_5 = 0;

10: d[d < np.spacing(1)] = 1.0

/* "_cython_magic_637c713b986c525e98b048fef3dc5c09.pyx":10 * # Avoid divisions by almost 0 numbers * cdef np.ndarray[np.float64_t, ndim=1] d = np.sqrt(np.sum(vec ** 2, axis=1)) * d[d < np.spacing(1)] = 1.0 # < < < < < < < < < < < < < < * return vec / d[..., None] * */ __pyx_t_5 = PyFloat_FromDouble (1.0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_5); __pyx_t_1 = __Pyx_GetModuleGlobalName (__pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_1); __pyx_t_2 = __Pyx_ PyObject_GetAttrStr (__pyx_t_1, __pyx_n_s__spacing); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_2); __Pyx_DECREF (__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_Call (__pyx_t_2, ((PyObject *)__pyx_k_tuple_1), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_1); __Pyx_DECREF (__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyObject_RichCompare (((PyObject *)__pyx_v_d), __pyx_t_1, Py_LT); __Pyx_XGOTREF (__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF (__pyx_t_1); __pyx_t_1 = 0; if ( PyObject_SetItem (((PyObject *)__pyx_v_d), __pyx_t_2, __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF (__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF (__pyx_t_5); __pyx_t_5 = 0; /* "_cython_magic_637c713b986c525e98b048fef3dc5c09.pyx":10 * # Avoid divisions by almost 0 numbers * cdef np.ndarray[np.float64_t, ndim=1] d = np.sqrt(np.sum(vec ** 2, axis=1)) * d[d < np.spacing(1)] = 1.0 # < < < < < < < < < < < < < < * return vec / d[..., None] * */ __pyx_k_tuple_1 = PyTuple_Pack (1, __pyx_int_1); if (unlikely(!__pyx_k_tuple_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_k_tuple_1); __Pyx_GIVEREF (((PyObject *)__pyx_k_tuple_1));

11: return vec / d[..., None]

/* "_cython_magic_637c713b986c525e98b048fef3dc5c09.pyx":11 * cdef np.ndarray[np.float64_t, ndim=1] d = np.sqrt(np.sum(vec ** 2, axis=1)) * d[d < np.spacing(1)] = 1.0 * return vec / d[..., None] # < < < < < < < < < < < < < < * * */ __Pyx_XDECREF (((PyObject *)__pyx_r)); __pyx_t_5 = PyObject_GetItem (((PyObject *)__pyx_v_d), ((PyObject *)__pyx_k_tuple_2)); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_5); __pyx_t_2 = __Pyx_ PyNumber_Divide (((PyObject *)__pyx_v_vec), __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_2); __Pyx_DECREF (__pyx_t_5); __pyx_t_5 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely( __Pyx_TypeTest (__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_r = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; goto __pyx_L0; __pyx_r = ((PyArrayObject *)Py_None); __Pyx_INCREF (Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF (__pyx_t_1); __Pyx_XDECREF (__pyx_t_2); __Pyx_XDECREF (__pyx_t_3); __Pyx_XDECREF (__pyx_t_4); __Pyx_XDECREF (__pyx_t_5); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_ErrFetch (&__pyx_type, &__pyx_value, &__pyx_tb); __Pyx_SafeReleaseBuffer (&__pyx_pybuffernd_d.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer (&__pyx_pybuffernd_vec.rcbuffer->pybuffer); __Pyx_ErrRestore (__pyx_type, __pyx_value, __pyx_tb);} __Pyx_AddTraceback ("_cython_magic_637c713b986c525e98b048fef3dc5c09.normalise", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; goto __pyx_L2; __pyx_L0:; __Pyx_SafeReleaseBuffer (&__pyx_pybuffernd_d.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer (&__pyx_pybuffernd_vec.rcbuffer->pybuffer); __pyx_L2:; __Pyx_XDECREF ((PyObject *)__pyx_v_d); __Pyx_XGIVEREF ((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext (); return __pyx_r; } /* "_cython_magic_637c713b986c525e98b048fef3dc5c09.pyx":11 * cdef np.ndarray[np.float64_t, ndim=1] d = np.sqrt(np.sum(vec ** 2, axis=1)) * d[d < np.spacing(1)] = 1.0 * return vec / d[..., None] # < < < < < < < < < < < < < < * * */ __pyx_k_tuple_2 = PyTuple_Pack (2, Py_Ellipsis, Py_None); if (unlikely(!__pyx_k_tuple_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_k_tuple_2); __Pyx_GIVEREF (((PyObject *)__pyx_k_tuple_2));

12:

13:

14: cdef inline np.ndarray[np.float64_t, ndim=2] cross(double[:, :] x, double[:, :] y):

/* "_cython_magic_637c713b986c525e98b048fef3dc5c09.pyx":14 * * * cdef inline np.ndarray[np.float64_t, ndim=2] cross(double[:, :] x, double[:, :] y): # < < < < < < < < < < < < < < * cdef np.ndarray[np.float64_t, ndim=2] z = np.empty_like(x) * cdef int n = x.shape[0] */ static CYTHON_INLINE PyArrayObject *__pyx_f_46_cython_magic_637c713b986c525e98b048fef3dc5c09_cross(__Pyx_memviewslice __pyx_v_x, __Pyx_memviewslice __pyx_v_y) { PyArrayObject *__pyx_v_z = 0; int __pyx_v_n; int __pyx_v_i; __Pyx_LocalBuf_ND __pyx_pybuffernd_z; __Pyx_Buffer __pyx_pybuffer_z; PyArrayObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext ("cross", 0); __pyx_pybuffer_z.pybuffer.buf = NULL; __pyx_pybuffer_z.refcount = 0; __pyx_pybuffernd_z.data = NULL; __pyx_pybuffernd_z.rcbuffer = &__pyx_pybuffer_z;

15: cdef np.ndarray[np.float64_t, ndim=2] z = np.empty_like(x)

/* "_cython_magic_637c713b986c525e98b048fef3dc5c09.pyx":15 * * cdef inline np.ndarray[np.float64_t, ndim=2] cross(double[:, :] x, double[:, :] y): * cdef np.ndarray[np.float64_t, ndim=2] z = np.empty_like(x) # < < < < < < < < < < < < < < * cdef int n = x.shape[0] * for i in range(n): */ __pyx_t_1 = __Pyx_GetModuleGlobalName (__pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_1); __pyx_t_2 = __Pyx_ PyObject_GetAttrStr (__pyx_t_1, __pyx_n_s__empty_like); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_2); __Pyx_DECREF (__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_x, 2, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_1); __pyx_t_3 = PyTuple_New (1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_3); PyTuple_SET_ITEM (__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF (__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyObject_Call (__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_1); __Pyx_DECREF (__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF (((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; if (!(likely(((__pyx_t_1) == Py_None) || likely( __Pyx_TypeTest (__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_4 = ((PyArrayObject *)__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely( __Pyx_GetBufferAndValidate (&__pyx_pybuffernd_z.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_z = ((PyArrayObject *)Py_None); __Pyx_INCREF (Py_None); __pyx_pybuffernd_z.rcbuffer->pybuffer.buf = NULL; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_pybuffernd_z.diminfo[0].strides = __pyx_pybuffernd_z.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_z.diminfo[0].shape = __pyx_pybuffernd_z.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_z.diminfo[1].strides = __pyx_pybuffernd_z.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_z.diminfo[1].shape = __pyx_pybuffernd_z.rcbuffer->pybuffer.shape[1]; } } __pyx_t_4 = 0; __pyx_v_z = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0;

16: cdef int n = x.shape[0]

/* "_cython_magic_637c713b986c525e98b048fef3dc5c09.pyx":16 * cdef inline np.ndarray[np.float64_t, ndim=2] cross(double[:, :] x, double[:, :] y): * cdef np.ndarray[np.float64_t, ndim=2] z = np.empty_like(x) * cdef int n = x.shape[0] # < < < < < < < < < < < < < < * for i in range(n): * z[i, 0] = x[i, 1] * y[i, 2] - x[i, 2] * y[i, 1] */ __pyx_v_n = (__pyx_v_x.shape[0]);

17: for i in range(n):

/* "_cython_magic_637c713b986c525e98b048fef3dc5c09.pyx":17 * cdef np.ndarray[np.float64_t, ndim=2] z = np.empty_like(x) * cdef int n = x.shape[0] * for i in range(n): # < < < < < < < < < < < < < < * z[i, 0] = x[i, 1] * y[i, 2] - x[i, 2] * y[i, 1] * z[i, 1] = x[i, 2] * y[i, 0] - x[i, 0] * y[i, 2] */ __pyx_t_5 = __pyx_v_n; for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { __pyx_v_i = __pyx_t_6;

18: z[i, 0] = x[i, 1] * y[i, 2] - x[i, 2] * y[i, 1]

/* "_cython_magic_637c713b986c525e98b048fef3dc5c09.pyx":18 * cdef int n = x.shape[0] * for i in range(n): * z[i, 0] = x[i, 1] * y[i, 2] - x[i, 2] * y[i, 1] # < < < < < < < < < < < < < < * z[i, 1] = x[i, 2] * y[i, 0] - x[i, 0] * y[i, 2] * z[i, 2] = x[i, 0] * y[i, 1] - x[i, 1] * y[i, 0] */ __pyx_t_7 = __pyx_v_i; __pyx_t_8 = 1; __pyx_t_9 = -1; if (__pyx_t_7 < 0) { __pyx_t_7 += __pyx_v_x.shape[0]; if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 0; } else if (unlikely(__pyx_t_7 >= __pyx_v_x.shape[0])) __pyx_t_9 = 0; if (__pyx_t_8 < 0) { __pyx_t_8 += __pyx_v_x.shape[1]; if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 1; } else if (unlikely(__pyx_t_8 >= __pyx_v_x.shape[1])) __pyx_t_9 = 1; if (unlikely(__pyx_t_9 != -1)) { __Pyx_RaiseBufferIndexError (__pyx_t_9); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_9 = __pyx_v_i; __pyx_t_10 = 2; __pyx_t_11 = -1; if (__pyx_t_9 < 0) { __pyx_t_9 += __pyx_v_y.shape[0]; if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 0; } else if (unlikely(__pyx_t_9 >= __pyx_v_y.shape[0])) __pyx_t_11 = 0; if (__pyx_t_10 < 0) { __pyx_t_10 += __pyx_v_y.shape[1]; if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 1; } else if (unlikely(__pyx_t_10 >= __pyx_v_y.shape[1])) __pyx_t_11 = 1; if (unlikely(__pyx_t_11 != -1)) { __Pyx_RaiseBufferIndexError (__pyx_t_11); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_11 = __pyx_v_i; __pyx_t_12 = 2; __pyx_t_13 = -1; if (__pyx_t_11 < 0) { __pyx_t_11 += __pyx_v_x.shape[0]; if (unlikely(__pyx_t_11 < 0)) __pyx_t_13 = 0; } else if (unlikely(__pyx_t_11 >= __pyx_v_x.shape[0])) __pyx_t_13 = 0; if (__pyx_t_12 < 0) { __pyx_t_12 += __pyx_v_x.shape[1]; if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 1; } else if (unlikely(__pyx_t_12 >= __pyx_v_x.shape[1])) __pyx_t_13 = 1; if (unlikely(__pyx_t_13 != -1)) { __Pyx_RaiseBufferIndexError (__pyx_t_13); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_13 = __pyx_v_i; __pyx_t_14 = 1; __pyx_t_15 = -1; if (__pyx_t_13 < 0) { __pyx_t_13 += __pyx_v_y.shape[0]; if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 0; } else if (unlikely(__pyx_t_13 >= __pyx_v_y.shape[0])) __pyx_t_15 = 0; if (__pyx_t_14 < 0) { __pyx_t_14 += __pyx_v_y.shape[1]; if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 1; } else if (unlikely(__pyx_t_14 >= __pyx_v_y.shape[1])) __pyx_t_15 = 1; if (unlikely(__pyx_t_15 != -1)) { __Pyx_RaiseBufferIndexError (__pyx_t_15); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_15 = __pyx_v_i; __pyx_t_16 = 0; __pyx_t_17 = -1; if (__pyx_t_15 < 0) { __pyx_t_15 += __pyx_pybuffernd_z.diminfo[0].shape; if (unlikely(__pyx_t_15 < 0)) __pyx_t_17 = 0; } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_z.diminfo[0].shape)) __pyx_t_17 = 0; if (__pyx_t_16 < 0) { __pyx_t_16 += __pyx_pybuffernd_z.diminfo[1].shape; if (unlikely(__pyx_t_16 < 0)) __pyx_t_17 = 1; } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_z.diminfo[1].shape)) __pyx_t_17 = 1; if (unlikely(__pyx_t_17 != -1)) { __Pyx_RaiseBufferIndexError (__pyx_t_17); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_z.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_z.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_z.diminfo[1].strides) = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_x.data + __pyx_t_7 * __pyx_v_x.strides[0]) ) + __pyx_t_8 * __pyx_v_x.strides[1]) ))) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_y.data + __pyx_t_9 * __pyx_v_y.strides[0]) ) + __pyx_t_10 * __pyx_v_y.strides[1]) )))) - ((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_x.data + __pyx_t_11 * __pyx_v_x.strides[0]) ) + __pyx_t_12 * __pyx_v_x.strides[1]) ))) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_y.data + __pyx_t_13 * __pyx_v_y.strides[0]) ) + __pyx_t_14 * __pyx_v_y.strides[1]) )))));

19: z[i, 1] = x[i, 2] * y[i, 0] - x[i, 0] * y[i, 2]

/* "_cython_magic_637c713b986c525e98b048fef3dc5c09.pyx":19 * for i in range(n): * z[i, 0] = x[i, 1] * y[i, 2] - x[i, 2] * y[i, 1] * z[i, 1] = x[i, 2] * y[i, 0] - x[i, 0] * y[i, 2] # < < < < < < < < < < < < < < * z[i, 2] = x[i, 0] * y[i, 1] - x[i, 1] * y[i, 0] * */ __pyx_t_17 = __pyx_v_i; __pyx_t_18 = 2; __pyx_t_19 = -1; if (__pyx_t_17 < 0) { __pyx_t_17 += __pyx_v_x.shape[0]; if (unlikely(__pyx_t_17 < 0)) __pyx_t_19 = 0; } else if (unlikely(__pyx_t_17 >= __pyx_v_x.shape[0])) __pyx_t_19 = 0; if (__pyx_t_18 < 0) { __pyx_t_18 += __pyx_v_x.shape[1]; if (unlikely(__pyx_t_18 < 0)) __pyx_t_19 = 1; } else if (unlikely(__pyx_t_18 >= __pyx_v_x.shape[1])) __pyx_t_19 = 1; if (unlikely(__pyx_t_19 != -1)) { __Pyx_RaiseBufferIndexError (__pyx_t_19); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_19 = __pyx_v_i; __pyx_t_20 = 0; __pyx_t_21 = -1; if (__pyx_t_19 < 0) { __pyx_t_19 += __pyx_v_y.shape[0]; if (unlikely(__pyx_t_19 < 0)) __pyx_t_21 = 0; } else if (unlikely(__pyx_t_19 >= __pyx_v_y.shape[0])) __pyx_t_21 = 0; if (__pyx_t_20 < 0) { __pyx_t_20 += __pyx_v_y.shape[1]; if (unlikely(__pyx_t_20 < 0)) __pyx_t_21 = 1; } else if (unlikely(__pyx_t_20 >= __pyx_v_y.shape[1])) __pyx_t_21 = 1; if (unlikely(__pyx_t_21 != -1)) { __Pyx_RaiseBufferIndexError (__pyx_t_21); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_21 = __pyx_v_i; __pyx_t_22 = 0; __pyx_t_23 = -1; if (__pyx_t_21 < 0) { __pyx_t_21 += __pyx_v_x.shape[0]; if (unlikely(__pyx_t_21 < 0)) __pyx_t_23 = 0; } else if (unlikely(__pyx_t_21 >= __pyx_v_x.shape[0])) __pyx_t_23 = 0; if (__pyx_t_22 < 0) { __pyx_t_22 += __pyx_v_x.shape[1]; if (unlikely(__pyx_t_22 < 0)) __pyx_t_23 = 1; } else if (unlikely(__pyx_t_22 >= __pyx_v_x.shape[1])) __pyx_t_23 = 1; if (unlikely(__pyx_t_23 != -1)) { __Pyx_RaiseBufferIndexError (__pyx_t_23); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_23 = __pyx_v_i; __pyx_t_24 = 2; __pyx_t_25 = -1; if (__pyx_t_23 < 0) { __pyx_t_23 += __pyx_v_y.shape[0]; if (unlikely(__pyx_t_23 < 0)) __pyx_t_25 = 0; } else if (unlikely(__pyx_t_23 >= __pyx_v_y.shape[0])) __pyx_t_25 = 0; if (__pyx_t_24 < 0) { __pyx_t_24 += __pyx_v_y.shape[1]; if (unlikely(__pyx_t_24 < 0)) __pyx_t_25 = 1; } else if (unlikely(__pyx_t_24 >= __pyx_v_y.shape[1])) __pyx_t_25 = 1; if (unlikely(__pyx_t_25 != -1)) { __Pyx_RaiseBufferIndexError (__pyx_t_25); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_25 = __pyx_v_i; __pyx_t_26 = 1; __pyx_t_27 = -1; if (__pyx_t_25 < 0) { __pyx_t_25 += __pyx_pybuffernd_z.diminfo[0].shape; if (unlikely(__pyx_t_25 < 0)) __pyx_t_27 = 0; } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_z.diminfo[0].shape)) __pyx_t_27 = 0; if (__pyx_t_26 < 0) { __pyx_t_26 += __pyx_pybuffernd_z.diminfo[1].shape; if (unlikely(__pyx_t_26 < 0)) __pyx_t_27 = 1; } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_z.diminfo[1].shape)) __pyx_t_27 = 1; if (unlikely(__pyx_t_27 != -1)) { __Pyx_RaiseBufferIndexError (__pyx_t_27); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_z.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_z.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_z.diminfo[1].strides) = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_x.data + __pyx_t_17 * __pyx_v_x.strides[0]) ) + __pyx_t_18 * __pyx_v_x.strides[1]) ))) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_y.data + __pyx_t_19 * __pyx_v_y.strides[0]) ) + __pyx_t_20 * __pyx_v_y.strides[1]) )))) - ((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_x.data + __pyx_t_21 * __pyx_v_x.strides[0]) ) + __pyx_t_22 * __pyx_v_x.strides[1]) ))) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_y.data + __pyx_t_23 * __pyx_v_y.strides[0]) ) + __pyx_t_24 * __pyx_v_y.strides[1]) )))));

20: z[i, 2] = x[i, 0] * y[i, 1] - x[i, 1] * y[i, 0]

/* "_cython_magic_637c713b986c525e98b048fef3dc5c09.pyx":20 * z[i, 0] = x[i, 1] * y[i, 2] - x[i, 2] * y[i, 1] * z[i, 1] = x[i, 2] * y[i, 0] - x[i, 0] * y[i, 2] * z[i, 2] = x[i, 0] * y[i, 1] - x[i, 1] * y[i, 0] # < < < < < < < < < < < < < < * * return z */ __pyx_t_27 = __pyx_v_i; __pyx_t_28 = 0; __pyx_t_29 = -1; if (__pyx_t_27 < 0) { __pyx_t_27 += __pyx_v_x.shape[0]; if (unlikely(__pyx_t_27 < 0)) __pyx_t_29 = 0; } else if (unlikely(__pyx_t_27 >= __pyx_v_x.shape[0])) __pyx_t_29 = 0; if (__pyx_t_28 < 0) { __pyx_t_28 += __pyx_v_x.shape[1]; if (unlikely(__pyx_t_28 < 0)) __pyx_t_29 = 1; } else if (unlikely(__pyx_t_28 >= __pyx_v_x.shape[1])) __pyx_t_29 = 1; if (unlikely(__pyx_t_29 != -1)) { __Pyx_RaiseBufferIndexError (__pyx_t_29); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_29 = __pyx_v_i; __pyx_t_30 = 1; __pyx_t_31 = -1; if (__pyx_t_29 < 0) { __pyx_t_29 += __pyx_v_y.shape[0]; if (unlikely(__pyx_t_29 < 0)) __pyx_t_31 = 0; } else if (unlikely(__pyx_t_29 >= __pyx_v_y.shape[0])) __pyx_t_31 = 0; if (__pyx_t_30 < 0) { __pyx_t_30 += __pyx_v_y.shape[1]; if (unlikely(__pyx_t_30 < 0)) __pyx_t_31 = 1; } else if (unlikely(__pyx_t_30 >= __pyx_v_y.shape[1])) __pyx_t_31 = 1; if (unlikely(__pyx_t_31 != -1)) { __Pyx_RaiseBufferIndexError (__pyx_t_31); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_31 = __pyx_v_i; __pyx_t_32 = 1; __pyx_t_33 = -1; if (__pyx_t_31 < 0) { __pyx_t_31 += __pyx_v_x.shape[0]; if (unlikely(__pyx_t_31 < 0)) __pyx_t_33 = 0; } else if (unlikely(__pyx_t_31 >= __pyx_v_x.shape[0])) __pyx_t_33 = 0; if (__pyx_t_32 < 0) { __pyx_t_32 += __pyx_v_x.shape[1]; if (unlikely(__pyx_t_32 < 0)) __pyx_t_33 = 1; } else if (unlikely(__pyx_t_32 >= __pyx_v_x.shape[1])) __pyx_t_33 = 1; if (unlikely(__pyx_t_33 != -1)) { __Pyx_RaiseBufferIndexError (__pyx_t_33); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_33 = __pyx_v_i; __pyx_t_34 = 0; __pyx_t_35 = -1; if (__pyx_t_33 < 0) { __pyx_t_33 += __pyx_v_y.shape[0]; if (unlikely(__pyx_t_33 < 0)) __pyx_t_35 = 0; } else if (unlikely(__pyx_t_33 >= __pyx_v_y.shape[0])) __pyx_t_35 = 0; if (__pyx_t_34 < 0) { __pyx_t_34 += __pyx_v_y.shape[1]; if (unlikely(__pyx_t_34 < 0)) __pyx_t_35 = 1; } else if (unlikely(__pyx_t_34 >= __pyx_v_y.shape[1])) __pyx_t_35 = 1; if (unlikely(__pyx_t_35 != -1)) { __Pyx_RaiseBufferIndexError (__pyx_t_35); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_35 = __pyx_v_i; __pyx_t_36 = 2; __pyx_t_37 = -1; if (__pyx_t_35 < 0) { __pyx_t_35 += __pyx_pybuffernd_z.diminfo[0].shape; if (unlikely(__pyx_t_35 < 0)) __pyx_t_37 = 0; } else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_z.diminfo[0].shape)) __pyx_t_37 = 0; if (__pyx_t_36 < 0) { __pyx_t_36 += __pyx_pybuffernd_z.diminfo[1].shape; if (unlikely(__pyx_t_36 < 0)) __pyx_t_37 = 1; } else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_z.diminfo[1].shape)) __pyx_t_37 = 1; if (unlikely(__pyx_t_37 != -1)) { __Pyx_RaiseBufferIndexError (__pyx_t_37); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_z.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_z.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_z.diminfo[1].strides) = (((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_x.data + __pyx_t_27 * __pyx_v_x.strides[0]) ) + __pyx_t_28 * __pyx_v_x.strides[1]) ))) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_y.data + __pyx_t_29 * __pyx_v_y.strides[0]) ) + __pyx_t_30 * __pyx_v_y.strides[1]) )))) - ((*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_x.data + __pyx_t_31 * __pyx_v_x.strides[0]) ) + __pyx_t_32 * __pyx_v_x.strides[1]) ))) * (*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_y.data + __pyx_t_33 * __pyx_v_y.strides[0]) ) + __pyx_t_34 * __pyx_v_y.strides[1]) ))))); }

21:

22: return z

/* "_cython_magic_637c713b986c525e98b048fef3dc5c09.pyx":22 * z[i, 2] = x[i, 0] * y[i, 1] - x[i, 1] * y[i, 0] * * return z # < < < < < < < < < < < < < < * * */ __Pyx_XDECREF (((PyObject *)__pyx_r)); __Pyx_INCREF (((PyObject *)__pyx_v_z)); __pyx_r = ((PyArrayObject *)__pyx_v_z); goto __pyx_L0; __pyx_r = ((PyArrayObject *)Py_None); __Pyx_INCREF (Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF (__pyx_t_1); __Pyx_XDECREF (__pyx_t_2); __Pyx_XDECREF (__pyx_t_3); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_ErrFetch (&__pyx_type, &__pyx_value, &__pyx_tb); __Pyx_SafeReleaseBuffer (&__pyx_pybuffernd_z.rcbuffer->pybuffer); __Pyx_ErrRestore (__pyx_type, __pyx_value, __pyx_tb);} __Pyx_AddTraceback ("_cython_magic_637c713b986c525e98b048fef3dc5c09.cross", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; goto __pyx_L2; __pyx_L0:; __Pyx_SafeReleaseBuffer (&__pyx_pybuffernd_z.rcbuffer->pybuffer); __pyx_L2:; __Pyx_XDECREF ((PyObject *)__pyx_v_z); __Pyx_XGIVEREF ((PyObject *)__pyx_r); __Pyx_RefNannyFinishContext (); return __pyx_r; }

23:

24:

25: cpdef cy_compute_normal(np.ndarray[np.float64_t, ndim=2] vertex, np.ndarray[int, ndim=2] face):

/* "_cython_magic_637c713b986c525e98b048fef3dc5c09.pyx":25 * * * cpdef cy_compute_normal(np.ndarray[np.float64_t, ndim=2] vertex, np.ndarray[int, ndim=2] face): # < < < < < < < < < < < < < < * cdef int nface = face.shape[0] * cdef int nvert = vertex.shape[0] */ static PyObject *__pyx_pw_46_cython_magic_637c713b986c525e98b048fef3dc5c09_1cy_compute_normal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ static PyObject *__pyx_f_46_cython_magic_637c713b986c525e98b048fef3dc5c09_cy_compute_normal(PyArrayObject *__pyx_v_vertex, PyArrayObject *__pyx_v_face, CYTHON_UNUSED int __pyx_skip_dispatch) { int __pyx_v_nface; int __pyx_v_nvert; PyArrayObject *__pyx_v_normalf = 0; PyArrayObject *__pyx_v_normal = 0; int __pyx_v_f0; int __pyx_v_f1; int __pyx_v_f2; int __pyx_v_i; long __pyx_v_j; PyArrayObject *__pyx_v_v = 0; PyArrayObject *__pyx_v_s = 0; __Pyx_LocalBuf_ND __pyx_pybuffernd_face; __Pyx_Buffer __pyx_pybuffer_face; __Pyx_LocalBuf_ND __pyx_pybuffernd_normal; __Pyx_Buffer __pyx_pybuffer_normal; __Pyx_LocalBuf_ND __pyx_pybuffernd_normalf; __Pyx_Buffer __pyx_pybuffer_normalf; __Pyx_LocalBuf_ND __pyx_pybuffernd_s; __Pyx_Buffer __pyx_pybuffer_s; __Pyx_LocalBuf_ND __pyx_pybuffernd_v; __Pyx_Buffer __pyx_pybuffer_v; __Pyx_LocalBuf_ND __pyx_pybuffernd_vertex; __Pyx_Buffer __pyx_pybuffer_vertex; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext ("cy_compute_normal", 0); __pyx_pybuffer_normalf.pybuffer.buf = NULL; __pyx_pybuffer_normalf.refcount = 0; __pyx_pybuffernd_normalf.data = NULL; __pyx_pybuffernd_normalf.rcbuffer = &__pyx_pybuffer_normalf; __pyx_pybuffer_normal.pybuffer.buf = NULL; __pyx_pybuffer_normal.refcount = 0; __pyx_pybuffernd_normal.data = NULL; __pyx_pybuffernd_normal.rcbuffer = &__pyx_pybuffer_normal; __pyx_pybuffer_v.pybuffer.buf = NULL; __pyx_pybuffer_v.refcount = 0; __pyx_pybuffernd_v.data = NULL; __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v; __pyx_pybuffer_s.pybuffer.buf = NULL; __pyx_pybuffer_s.refcount = 0; __pyx_pybuffernd_s.data = NULL; __pyx_pybuffernd_s.rcbuffer = &__pyx_pybuffer_s; __pyx_pybuffer_vertex.pybuffer.buf = NULL; __pyx_pybuffer_vertex.refcount = 0; __pyx_pybuffernd_vertex.data = NULL; __pyx_pybuffernd_vertex.rcbuffer = &__pyx_pybuffer_vertex; __pyx_pybuffer_face.pybuffer.buf = NULL; __pyx_pybuffer_face.refcount = 0; __pyx_pybuffernd_face.data = NULL; __pyx_pybuffernd_face.rcbuffer = &__pyx_pybuffer_face; { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely( __Pyx_GetBufferAndValidate (&__pyx_pybuffernd_vertex.rcbuffer->pybuffer, (PyObject*)__pyx_v_vertex, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_vertex.diminfo[0].strides = __pyx_pybuffernd_vertex.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vertex.diminfo[0].shape = __pyx_pybuffernd_vertex.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_vertex.diminfo[1].strides = __pyx_pybuffernd_vertex.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_vertex.diminfo[1].shape = __pyx_pybuffernd_vertex.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely( __Pyx_GetBufferAndValidate (&__pyx_pybuffernd_face.rcbuffer->pybuffer, (PyObject*)__pyx_v_face, &__Pyx_TypeInfo_int, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_face.diminfo[0].strides = __pyx_pybuffernd_face.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_face.diminfo[0].shape = __pyx_pybuffernd_face.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_face.diminfo[1].strides = __pyx_pybuffernd_face.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_face.diminfo[1].shape = __pyx_pybuffernd_face.rcbuffer->pybuffer.shape[1]; /* "_cython_magic_637c713b986c525e98b048fef3dc5c09.pyx":25 * * * cpdef cy_compute_normal(np.ndarray[np.float64_t, ndim=2] vertex, np.ndarray[int, ndim=2] face): # < < < < < < < < < < < < < < * cdef int nface = face.shape[0] * cdef int nvert = vertex.shape[0] */ static PyObject *__pyx_pf_46_cython_magic_637c713b986c525e98b048fef3dc5c09_cy_compute_normal(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_vertex, PyArrayObject *__pyx_v_face) { __Pyx_LocalBuf_ND __pyx_pybuffernd_face; __Pyx_Buffer __pyx_pybuffer_face; __Pyx_LocalBuf_ND __pyx_pybuffernd_vertex; __Pyx_Buffer __pyx_pybuffer_vertex; PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext ("cy_compute_normal", 0); __pyx_pybuffer_vertex.pybuffer.buf = NULL; __pyx_pybuffer_vertex.refcount = 0; __pyx_pybuffernd_vertex.data = NULL; __pyx_pybuffernd_vertex.rcbuffer = &__pyx_pybuffer_vertex; __pyx_pybuffer_face.pybuffer.buf = NULL; __pyx_pybuffer_face.refcount = 0; __pyx_pybuffernd_face.data = NULL; __pyx_pybuffernd_face.rcbuffer = &__pyx_pybuffer_face; { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely( __Pyx_GetBufferAndValidate (&__pyx_pybuffernd_vertex.rcbuffer->pybuffer, (PyObject*)__pyx_v_vertex, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_vertex.diminfo[0].strides = __pyx_pybuffernd_vertex.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_vertex.diminfo[0].shape = __pyx_pybuffernd_vertex.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_vertex.diminfo[1].strides = __pyx_pybuffernd_vertex.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_vertex.diminfo[1].shape = __pyx_pybuffernd_vertex.rcbuffer->pybuffer.shape[1]; { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely( __Pyx_GetBufferAndValidate (&__pyx_pybuffernd_face.rcbuffer->pybuffer, (PyObject*)__pyx_v_face, &__Pyx_TypeInfo_int, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_pybuffernd_face.diminfo[0].strides = __pyx_pybuffernd_face.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_face.diminfo[0].shape = __pyx_pybuffernd_face.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_face.diminfo[1].strides = __pyx_pybuffernd_face.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_face.diminfo[1].shape = __pyx_pybuffernd_face.rcbuffer->pybuffer.shape[1]; __Pyx_XDECREF (__pyx_r); __pyx_t_1 = __pyx_f_46_cython_magic_637c713b986c525e98b048fef3dc5c09_cy_compute_normal(__pyx_v_vertex, __pyx_v_face, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_1); __pyx_r = __pyx_t_1; __pyx_t_1 = 0; goto __pyx_L0; __pyx_r = Py_None; __Pyx_INCREF (Py_None); goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF (__pyx_t_1); { PyObject *__pyx_type, *__pyx_value, *__pyx_tb; __Pyx_ErrFetch (&__pyx_type, &__pyx_value, &__pyx_tb); __Pyx_SafeReleaseBuffer (&__pyx_pybuffernd_face.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer (&__pyx_pybuffernd_vertex.rcbuffer->pybuffer); __Pyx_ErrRestore (__pyx_type, __pyx_value, __pyx_tb);} __Pyx_AddTraceback ("_cython_magic_637c713b986c525e98b048fef3dc5c09.cy_compute_normal", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; goto __pyx_L2; __pyx_L0:; __Pyx_SafeReleaseBuffer (&__pyx_pybuffernd_face.rcbuffer->pybuffer); __Pyx_SafeReleaseBuffer (&__pyx_pybuffernd_vertex.rcbuffer->pybuffer); __pyx_L2:; __Pyx_XGIVEREF (__pyx_r); __Pyx_RefNannyFinishContext (); return __pyx_r; } /* Python wrapper */ static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { int __pyx_r; __Pyx_RefNannyDeclarations __Pyx_RefNannySetupContext ("__getbuffer__ (wrapper)", 0); __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); __Pyx_RefNannyFinishContext (); return __pyx_r; }

26: cdef int nface = face.shape[0]

/* "_cython_magic_637c713b986c525e98b048fef3dc5c09.pyx":26 * * cpdef cy_compute_normal(np.ndarray[np.float64_t, ndim=2] vertex, np.ndarray[int, ndim=2] face): * cdef int nface = face.shape[0] # < < < < < < < < < < < < < < * cdef int nvert = vertex.shape[0] * */ __pyx_v_nface = (__pyx_v_face->dimensions[0]);

27: cdef int nvert = vertex.shape[0]

/* "_cython_magic_637c713b986c525e98b048fef3dc5c09.pyx":27 * cpdef cy_compute_normal(np.ndarray[np.float64_t, ndim=2] vertex, np.ndarray[int, ndim=2] face): * cdef int nface = face.shape[0] * cdef int nvert = vertex.shape[0] # < < < < < < < < < < < < < < * * # unit normals to the faces */ __pyx_v_nvert = (__pyx_v_vertex->dimensions[0]);

28:

29: # unit normals to the faces

30: cdef np.ndarray[np.float64_t, ndim=2] normalf = cross(vertex[face[:, 1], :] - vertex[face[:, 0], :],

/* "_cython_magic_637c713b986c525e98b048fef3dc5c09.pyx":30 * * # unit normals to the faces * cdef np.ndarray[np.float64_t, ndim=2] normalf = cross(vertex[face[:, 1], :] - vertex[face[:, 0], :], # < < < < < < < < < < < < < < * vertex[face[:, 2], :] - vertex[face[:, 0], :]) * normalf = normalise(normalf) */ __pyx_k_slice_3 = PySlice_New (Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_slice_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_k_slice_3); __Pyx_GIVEREF (__pyx_k_slice_3); /* "_cython_magic_637c713b986c525e98b048fef3dc5c09.pyx":30 * * # unit normals to the faces * cdef np.ndarray[np.float64_t, ndim=2] normalf = cross(vertex[face[:, 1], :] - vertex[face[:, 0], :], # < < < < < < < < < < < < < < * vertex[face[:, 2], :] - vertex[face[:, 0], :]) * normalf = normalise(normalf) */ __pyx_t_1 = PyObject_GetItem (((PyObject *)__pyx_v_face), ((PyObject *)__pyx_k_tuple_4)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_1); __pyx_k_tuple_4 = PyTuple_Pack (2, __pyx_k_slice_3, __pyx_int_1); if (unlikely(!__pyx_k_tuple_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_k_tuple_4); __Pyx_GIVEREF (((PyObject *)__pyx_k_tuple_4)); __pyx_t_2 = PyTuple_New (2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_2); PyTuple_SET_ITEM (__pyx_t_2, 0, __pyx_t_1); __Pyx_GIVEREF (__pyx_t_1); __Pyx_INCREF (__pyx_k_slice_5); PyTuple_SET_ITEM (__pyx_t_2, 1, __pyx_k_slice_5); __Pyx_GIVEREF (__pyx_k_slice_5); __pyx_t_1 = 0; __pyx_t_1 = PyObject_GetItem (((PyObject *)__pyx_v_vertex), ((PyObject *)__pyx_t_2)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_1); __Pyx_DECREF (((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_k_slice_5 = PySlice_New (Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_slice_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_k_slice_5); __Pyx_GIVEREF (__pyx_k_slice_5); __pyx_k_slice_6 = PySlice_New (Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_slice_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_k_slice_6); __Pyx_GIVEREF (__pyx_k_slice_6); __pyx_t_2 = PyObject_GetItem (((PyObject *)__pyx_v_face), ((PyObject *)__pyx_k_tuple_7)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_2); __pyx_k_tuple_7 = PyTuple_Pack (2, __pyx_k_slice_6, __pyx_int_0); if (unlikely(!__pyx_k_tuple_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_k_tuple_7); __Pyx_GIVEREF (((PyObject *)__pyx_k_tuple_7)); __pyx_t_3 = PyTuple_New (2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_3); PyTuple_SET_ITEM (__pyx_t_3, 0, __pyx_t_2); __Pyx_GIVEREF (__pyx_t_2); __Pyx_INCREF (__pyx_k_slice_8); PyTuple_SET_ITEM (__pyx_t_3, 1, __pyx_k_slice_8); __Pyx_GIVEREF (__pyx_k_slice_8); __pyx_t_2 = 0; __pyx_t_2 = PyObject_GetItem (((PyObject *)__pyx_v_vertex), ((PyObject *)__pyx_t_3)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_2); __Pyx_DECREF (((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __pyx_t_3 = PyNumber_Subtract (__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_3); __Pyx_DECREF (__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF (__pyx_t_2); __pyx_t_2 = 0; __pyx_t_4 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double (__pyx_t_3); if (unlikely(!__pyx_t_4.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF (__pyx_t_3); __pyx_t_3 = 0; __pyx_k_slice_8 = PySlice_New (Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_slice_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_k_slice_8); __Pyx_GIVEREF (__pyx_k_slice_8);

31: vertex[face[:, 2], :] - vertex[face[:, 0], :])

/* "_cython_magic_637c713b986c525e98b048fef3dc5c09.pyx":31 * # unit normals to the faces * cdef np.ndarray[np.float64_t, ndim=2] normalf = cross(vertex[face[:, 1], :] - vertex[face[:, 0], :], * vertex[face[:, 2], :] - vertex[face[:, 0], :]) # < < < < < < < < < < < < < < * normalf = normalise(normalf) * */ __pyx_k_slice_9 = PySlice_New (Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_slice_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_k_slice_9); __Pyx_GIVEREF (__pyx_k_slice_9); /* "_cython_magic_637c713b986c525e98b048fef3dc5c09.pyx":31 * # unit normals to the faces * cdef np.ndarray[np.float64_t, ndim=2] normalf = cross(vertex[face[:, 1], :] - vertex[face[:, 0], :], * vertex[face[:, 2], :] - vertex[face[:, 0], :]) # < < < < < < < < < < < < < < * normalf = normalise(normalf) * */ __pyx_t_3 = PyObject_GetItem (((PyObject *)__pyx_v_face), ((PyObject *)__pyx_k_tuple_10)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_3); __pyx_k_tuple_10 = PyTuple_Pack (2, __pyx_k_slice_9, __pyx_int_2); if (unlikely(!__pyx_k_tuple_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_k_tuple_10); __Pyx_GIVEREF (((PyObject *)__pyx_k_tuple_10)); __pyx_t_2 = PyTuple_New (2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_2); PyTuple_SET_ITEM (__pyx_t_2, 0, __pyx_t_3); __Pyx_GIVEREF (__pyx_t_3); __Pyx_INCREF (__pyx_k_slice_11); PyTuple_SET_ITEM (__pyx_t_2, 1, __pyx_k_slice_11); __Pyx_GIVEREF (__pyx_k_slice_11); __pyx_t_3 = 0; __pyx_t_3 = PyObject_GetItem (((PyObject *)__pyx_v_vertex), ((PyObject *)__pyx_t_2)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_3); __Pyx_DECREF (((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; __pyx_k_slice_11 = PySlice_New (Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_slice_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_k_slice_11); __Pyx_GIVEREF (__pyx_k_slice_11); __pyx_k_slice_12 = PySlice_New (Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_slice_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_k_slice_12); __Pyx_GIVEREF (__pyx_k_slice_12); __pyx_t_2 = PyObject_GetItem (((PyObject *)__pyx_v_face), ((PyObject *)__pyx_k_tuple_13)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_2); __pyx_k_tuple_13 = PyTuple_Pack (2, __pyx_k_slice_12, __pyx_int_0); if (unlikely(!__pyx_k_tuple_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_k_tuple_13); __Pyx_GIVEREF (((PyObject *)__pyx_k_tuple_13)); __pyx_t_1 = PyTuple_New (2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_1); PyTuple_SET_ITEM (__pyx_t_1, 0, __pyx_t_2); __Pyx_GIVEREF (__pyx_t_2); __Pyx_INCREF (__pyx_k_slice_14); PyTuple_SET_ITEM (__pyx_t_1, 1, __pyx_k_slice_14); __Pyx_GIVEREF (__pyx_k_slice_14); __pyx_t_2 = 0; __pyx_t_2 = PyObject_GetItem (((PyObject *)__pyx_v_vertex), ((PyObject *)__pyx_t_1)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_2); __Pyx_DECREF (((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __pyx_t_1 = PyNumber_Subtract (__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_1); __Pyx_DECREF (__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF (__pyx_t_2); __pyx_t_2 = 0; __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double (__pyx_t_1); if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF (__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = ((PyObject *)__pyx_f_46_cython_magic_637c713b986c525e98b048fef3dc5c09_cross(__pyx_t_4, __pyx_t_5)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_1); __PYX_XDEC_MEMVIEW(&__pyx_t_4, 1); __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely( __Pyx_GetBufferAndValidate (&__pyx_pybuffernd_normalf.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { __pyx_v_normalf = ((PyArrayObject *)Py_None); __Pyx_INCREF (Py_None); __pyx_pybuffernd_normalf.rcbuffer->pybuffer.buf = NULL; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_pybuffernd_normalf.diminfo[0].strides = __pyx_pybuffernd_normalf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_normalf.diminfo[0].shape = __pyx_pybuffernd_normalf.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_normalf.diminfo[1].strides = __pyx_pybuffernd_normalf.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_normalf.diminfo[1].shape = __pyx_pybuffernd_normalf.rcbuffer->pybuffer.shape[1]; } } __pyx_v_normalf = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0; __pyx_k_slice_14 = PySlice_New (Py_None, Py_None, Py_None); if (unlikely(!__pyx_k_slice_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_k_slice_14); __Pyx_GIVEREF (__pyx_k_slice_14);

32: normalf = normalise(normalf)

/* "_cython_magic_637c713b986c525e98b048fef3dc5c09.pyx":32 * cdef np.ndarray[np.float64_t, ndim=2] normalf = cross(vertex[face[:, 1], :] - vertex[face[:, 0], :], * vertex[face[:, 2], :] - vertex[face[:, 0], :]) * normalf = normalise(normalf) # < < < < < < < < < < < < < < * * # unit normal to the vertex */ __pyx_t_1 = ((PyObject *)__pyx_f_46_cython_magic_637c713b986c525e98b048fef3dc5c09_normalise(((PyArrayObject *)__pyx_v_normalf))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_1); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer (&__pyx_pybuffernd_normalf.rcbuffer->pybuffer); __pyx_t_6 = __Pyx_GetBufferAndValidate (&__pyx_pybuffernd_normalf.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_1), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); if (unlikely(__pyx_t_6 < 0)) { PyErr_Fetch (&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); if (unlikely( __Pyx_GetBufferAndValidate (&__pyx_pybuffernd_normalf.rcbuffer->pybuffer, (PyObject*)__pyx_v_normalf, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); __Pyx_RaiseBufferFallbackError (); } else { PyErr_Restore (__pyx_t_7, __pyx_t_8, __pyx_t_9); } } __pyx_pybuffernd_normalf.diminfo[0].strides = __pyx_pybuffernd_normalf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_normalf.diminfo[0].shape = __pyx_pybuffernd_normalf.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_normalf.diminfo[1].strides = __pyx_pybuffernd_normalf.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_normalf.diminfo[1].shape = __pyx_pybuffernd_normalf.rcbuffer->pybuffer.shape[1]; if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF (((PyObject *)__pyx_v_normalf)); __pyx_v_normalf = ((PyArrayObject *)__pyx_t_1); __pyx_t_1 = 0;

33:

34: # unit normal to the vertex

35: cdef np.ndarray[np.float64_t, ndim=2] normal = np.zeros([nvert, 3])

/* "_cython_magic_637c713b986c525e98b048fef3dc5c09.pyx":35 * * # unit normal to the vertex * cdef np.ndarray[np.float64_t, ndim=2] normal = np.zeros([nvert, 3]) # < < < < < < < < < < < < < < * cdef int f0, f1, f2 * for i in range(nface): */ __pyx_t_1 = __Pyx_GetModuleGlobalName (__pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_1); __pyx_t_2 = __Pyx_ PyObject_GetAttrStr (__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_2); __Pyx_DECREF (__pyx_t_1); __pyx_t_1 = 0; __pyx_t_1 = PyInt_FromLong (__pyx_v_nvert); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_1); __pyx_t_3 = PyList_New (2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_3); PyList_SET_ITEM (__pyx_t_3, 0, __pyx_t_1); __Pyx_GIVEREF (__pyx_t_1); __Pyx_INCREF (__pyx_int_3); PyList_SET_ITEM (__pyx_t_3, 1, __pyx_int_3); __Pyx_GIVEREF (__pyx_int_3); __pyx_t_1 = 0; __pyx_t_1 = PyTuple_New (1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_1); PyTuple_SET_ITEM (__pyx_t_1, 0, ((PyObject *)__pyx_t_3)); __Pyx_GIVEREF (((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __pyx_t_3 = PyObject_Call (__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_3); __Pyx_DECREF (__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF (((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; if (!(likely(((__pyx_t_3) == Py_None) || likely( __Pyx_TypeTest (__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_10 = ((PyArrayObject *)__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely( __Pyx_GetBufferAndValidate (&__pyx_pybuffernd_normal.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { __pyx_v_normal = ((PyArrayObject *)Py_None); __Pyx_INCREF (Py_None); __pyx_pybuffernd_normal.rcbuffer->pybuffer.buf = NULL; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_pybuffernd_normal.diminfo[0].strides = __pyx_pybuffernd_normal.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_normal.diminfo[0].shape = __pyx_pybuffernd_normal.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_normal.diminfo[1].strides = __pyx_pybuffernd_normal.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_normal.diminfo[1].shape = __pyx_pybuffernd_normal.rcbuffer->pybuffer.shape[1]; } } __pyx_t_10 = 0; __pyx_v_normal = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0;

36: cdef int f0, f1, f2

37: for i in range(nface):

/* "_cython_magic_637c713b986c525e98b048fef3dc5c09.pyx":37 * cdef np.ndarray[np.float64_t, ndim=2] normal = np.zeros([nvert, 3]) * cdef int f0, f1, f2 * for i in range(nface): # < < < < < < < < < < < < < < * f0 = face[i, 0] * f1 = face[i, 1] */ __pyx_t_6 = __pyx_v_nface; for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_6; __pyx_t_11+=1) { __pyx_v_i = __pyx_t_11;

38: f0 = face[i, 0]

/* "_cython_magic_637c713b986c525e98b048fef3dc5c09.pyx":38 * cdef int f0, f1, f2 * for i in range(nface): * f0 = face[i, 0] # < < < < < < < < < < < < < < * f1 = face[i, 1] * f2 = face[i, 2] */ __pyx_t_12 = __pyx_v_i; __pyx_t_13 = 0; __pyx_t_14 = -1; if (__pyx_t_12 < 0) { __pyx_t_12 += __pyx_pybuffernd_face.diminfo[0].shape; if (unlikely(__pyx_t_12 < 0)) __pyx_t_14 = 0; } else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_face.diminfo[0].shape)) __pyx_t_14 = 0; if (__pyx_t_13 < 0) { __pyx_t_13 += __pyx_pybuffernd_face.diminfo[1].shape; if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 1; } else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_face.diminfo[1].shape)) __pyx_t_14 = 1; if (unlikely(__pyx_t_14 != -1)) { __Pyx_RaiseBufferIndexError (__pyx_t_14); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_f0 = (*__Pyx_BufPtrStrided2d(int *, __pyx_pybuffernd_face.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_face.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_face.diminfo[1].strides));

39: f1 = face[i, 1]

/* "_cython_magic_637c713b986c525e98b048fef3dc5c09.pyx":39 * for i in range(nface): * f0 = face[i, 0] * f1 = face[i, 1] # < < < < < < < < < < < < < < * f2 = face[i, 2] * for j in range(3): */ __pyx_t_14 = __pyx_v_i; __pyx_t_15 = 1; __pyx_t_16 = -1; if (__pyx_t_14 < 0) { __pyx_t_14 += __pyx_pybuffernd_face.diminfo[0].shape; if (unlikely(__pyx_t_14 < 0)) __pyx_t_16 = 0; } else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_face.diminfo[0].shape)) __pyx_t_16 = 0; if (__pyx_t_15 < 0) { __pyx_t_15 += __pyx_pybuffernd_face.diminfo[1].shape; if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 1; } else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_face.diminfo[1].shape)) __pyx_t_16 = 1; if (unlikely(__pyx_t_16 != -1)) { __Pyx_RaiseBufferIndexError (__pyx_t_16); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_f1 = (*__Pyx_BufPtrStrided2d(int *, __pyx_pybuffernd_face.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_face.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_face.diminfo[1].strides));

40: f2 = face[i, 2]

/* "_cython_magic_637c713b986c525e98b048fef3dc5c09.pyx":40 * f0 = face[i, 0] * f1 = face[i, 1] * f2 = face[i, 2] # < < < < < < < < < < < < < < * for j in range(3): * normal[f0, j] += normalf[i, j] */ __pyx_t_16 = __pyx_v_i; __pyx_t_17 = 2; __pyx_t_18 = -1; if (__pyx_t_16 < 0) { __pyx_t_16 += __pyx_pybuffernd_face.diminfo[0].shape; if (unlikely(__pyx_t_16 < 0)) __pyx_t_18 = 0; } else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_face.diminfo[0].shape)) __pyx_t_18 = 0; if (__pyx_t_17 < 0) { __pyx_t_17 += __pyx_pybuffernd_face.diminfo[1].shape; if (unlikely(__pyx_t_17 < 0)) __pyx_t_18 = 1; } else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_face.diminfo[1].shape)) __pyx_t_18 = 1; if (unlikely(__pyx_t_18 != -1)) { __Pyx_RaiseBufferIndexError (__pyx_t_18); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_v_f2 = (*__Pyx_BufPtrStrided2d(int *, __pyx_pybuffernd_face.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_face.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_face.diminfo[1].strides));

41: for j in range(3):

/* "_cython_magic_637c713b986c525e98b048fef3dc5c09.pyx":41 * f1 = face[i, 1] * f2 = face[i, 2] * for j in range(3): # < < < < < < < < < < < < < < * normal[f0, j] += normalf[i, j] * normal[f1, j] += normalf[i, j] */ for (__pyx_t_19 = 0; __pyx_t_19 < 3; __pyx_t_19+=1) { __pyx_v_j = __pyx_t_19;

42: normal[f0, j] += normalf[i, j]

/* "_cython_magic_637c713b986c525e98b048fef3dc5c09.pyx":42 * f2 = face[i, 2] * for j in range(3): * normal[f0, j] += normalf[i, j] # < < < < < < < < < < < < < < * normal[f1, j] += normalf[i, j] * normal[f2, j] += normalf[i, j] */ __pyx_t_18 = __pyx_v_i; __pyx_t_20 = __pyx_v_j; __pyx_t_21 = -1; if (__pyx_t_18 < 0) { __pyx_t_18 += __pyx_pybuffernd_normalf.diminfo[0].shape; if (unlikely(__pyx_t_18 < 0)) __pyx_t_21 = 0; } else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_normalf.diminfo[0].shape)) __pyx_t_21 = 0; if (__pyx_t_20 < 0) { __pyx_t_20 += __pyx_pybuffernd_normalf.diminfo[1].shape; if (unlikely(__pyx_t_20 < 0)) __pyx_t_21 = 1; } else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_normalf.diminfo[1].shape)) __pyx_t_21 = 1; if (unlikely(__pyx_t_21 != -1)) { __Pyx_RaiseBufferIndexError (__pyx_t_21); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_21 = __pyx_v_f0; __pyx_t_22 = __pyx_v_j; __pyx_t_23 = -1; if (__pyx_t_21 < 0) { __pyx_t_21 += __pyx_pybuffernd_normal.diminfo[0].shape; if (unlikely(__pyx_t_21 < 0)) __pyx_t_23 = 0; } else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_normal.diminfo[0].shape)) __pyx_t_23 = 0; if (__pyx_t_22 < 0) { __pyx_t_22 += __pyx_pybuffernd_normal.diminfo[1].shape; if (unlikely(__pyx_t_22 < 0)) __pyx_t_23 = 1; } else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_normal.diminfo[1].shape)) __pyx_t_23 = 1; if (unlikely(__pyx_t_23 != -1)) { __Pyx_RaiseBufferIndexError (__pyx_t_23); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_normal.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_normal.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_normal.diminfo[1].strides) += (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_normalf.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_normalf.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_normalf.diminfo[1].strides));

43: normal[f1, j] += normalf[i, j]

/* "_cython_magic_637c713b986c525e98b048fef3dc5c09.pyx":43 * for j in range(3): * normal[f0, j] += normalf[i, j] * normal[f1, j] += normalf[i, j] # < < < < < < < < < < < < < < * normal[f2, j] += normalf[i, j] * */ __pyx_t_23 = __pyx_v_i; __pyx_t_24 = __pyx_v_j; __pyx_t_25 = -1; if (__pyx_t_23 < 0) { __pyx_t_23 += __pyx_pybuffernd_normalf.diminfo[0].shape; if (unlikely(__pyx_t_23 < 0)) __pyx_t_25 = 0; } else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_normalf.diminfo[0].shape)) __pyx_t_25 = 0; if (__pyx_t_24 < 0) { __pyx_t_24 += __pyx_pybuffernd_normalf.diminfo[1].shape; if (unlikely(__pyx_t_24 < 0)) __pyx_t_25 = 1; } else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_normalf.diminfo[1].shape)) __pyx_t_25 = 1; if (unlikely(__pyx_t_25 != -1)) { __Pyx_RaiseBufferIndexError (__pyx_t_25); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_25 = __pyx_v_f1; __pyx_t_26 = __pyx_v_j; __pyx_t_27 = -1; if (__pyx_t_25 < 0) { __pyx_t_25 += __pyx_pybuffernd_normal.diminfo[0].shape; if (unlikely(__pyx_t_25 < 0)) __pyx_t_27 = 0; } else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_normal.diminfo[0].shape)) __pyx_t_27 = 0; if (__pyx_t_26 < 0) { __pyx_t_26 += __pyx_pybuffernd_normal.diminfo[1].shape; if (unlikely(__pyx_t_26 < 0)) __pyx_t_27 = 1; } else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_normal.diminfo[1].shape)) __pyx_t_27 = 1; if (unlikely(__pyx_t_27 != -1)) { __Pyx_RaiseBufferIndexError (__pyx_t_27); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_normal.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_normal.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_normal.diminfo[1].strides) += (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_normalf.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_normalf.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_normalf.diminfo[1].strides));

44: normal[f2, j] += normalf[i, j]

/* "_cython_magic_637c713b986c525e98b048fef3dc5c09.pyx":44 * normal[f0, j] += normalf[i, j] * normal[f1, j] += normalf[i, j] * normal[f2, j] += normalf[i, j] # < < < < < < < < < < < < < < * * # normalize */ __pyx_t_27 = __pyx_v_i; __pyx_t_28 = __pyx_v_j; __pyx_t_29 = -1; if (__pyx_t_27 < 0) { __pyx_t_27 += __pyx_pybuffernd_normalf.diminfo[0].shape; if (unlikely(__pyx_t_27 < 0)) __pyx_t_29 = 0; } else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_normalf.diminfo[0].shape)) __pyx_t_29 = 0; if (__pyx_t_28 < 0) { __pyx_t_28 += __pyx_pybuffernd_normalf.diminfo[1].shape; if (unlikely(__pyx_t_28 < 0)) __pyx_t_29 = 1; } else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_normalf.diminfo[1].shape)) __pyx_t_29 = 1; if (unlikely(__pyx_t_29 != -1)) { __Pyx_RaiseBufferIndexError (__pyx_t_29); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_29 = __pyx_v_f2; __pyx_t_30 = __pyx_v_j; __pyx_t_31 = -1; if (__pyx_t_29 < 0) { __pyx_t_29 += __pyx_pybuffernd_normal.diminfo[0].shape; if (unlikely(__pyx_t_29 < 0)) __pyx_t_31 = 0; } else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_normal.diminfo[0].shape)) __pyx_t_31 = 0; if (__pyx_t_30 < 0) { __pyx_t_30 += __pyx_pybuffernd_normal.diminfo[1].shape; if (unlikely(__pyx_t_30 < 0)) __pyx_t_31 = 1; } else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_normal.diminfo[1].shape)) __pyx_t_31 = 1; if (unlikely(__pyx_t_31 != -1)) { __Pyx_RaiseBufferIndexError (__pyx_t_31); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } *__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_normal.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_normal.diminfo[0].strides, __pyx_t_30, __pyx_pybuffernd_normal.diminfo[1].strides) += (*__Pyx_BufPtrStrided2d(__pyx_t_5numpy_float64_t *, __pyx_pybuffernd_normalf.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_normalf.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_normalf.diminfo[1].strides)); } }

45:

46: # normalize

47: normal = normalise(normal)

/* "_cython_magic_637c713b986c525e98b048fef3dc5c09.pyx":47 * * # normalize * normal = normalise(normal) # < < < < < < < < < < < < < < * * # enforce that the normal are outward */ __pyx_t_3 = ((PyObject *)__pyx_f_46_cython_magic_637c713b986c525e98b048fef3dc5c09_normalise(((PyArrayObject *)__pyx_v_normal))); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_3); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer (&__pyx_pybuffernd_normal.rcbuffer->pybuffer); __pyx_t_6 = __Pyx_GetBufferAndValidate (&__pyx_pybuffernd_normal.rcbuffer->pybuffer, (PyObject*)((PyArrayObject *)__pyx_t_3), &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); if (unlikely(__pyx_t_6 < 0)) { PyErr_Fetch (&__pyx_t_9, &__pyx_t_8, &__pyx_t_7); if (unlikely( __Pyx_GetBufferAndValidate (&__pyx_pybuffernd_normal.rcbuffer->pybuffer, (PyObject*)__pyx_v_normal, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); __Pyx_RaiseBufferFallbackError (); } else { PyErr_Restore (__pyx_t_9, __pyx_t_8, __pyx_t_7); } } __pyx_pybuffernd_normal.diminfo[0].strides = __pyx_pybuffernd_normal.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_normal.diminfo[0].shape = __pyx_pybuffernd_normal.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_normal.diminfo[1].strides = __pyx_pybuffernd_normal.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_normal.diminfo[1].shape = __pyx_pybuffernd_normal.rcbuffer->pybuffer.shape[1]; if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __Pyx_DECREF (((PyObject *)__pyx_v_normal)); __pyx_v_normal = ((PyArrayObject *)__pyx_t_3); __pyx_t_3 = 0;

48:

49: # enforce that the normal are outward

50: cdef np.ndarray[np.float64_t, ndim=2] v = vertex - np.mean(vertex)[..., None]

/* "_cython_magic_637c713b986c525e98b048fef3dc5c09.pyx":50 * * # enforce that the normal are outward * cdef np.ndarray[np.float64_t, ndim=2] v = vertex - np.mean(vertex)[..., None] # < < < < < < < < < < < < < < * cdef np.ndarray[np.float64_t, ndim=1] s = np.sum(v * normal, axis=1) * if np.sum(np.greater(s, 0)) < np.sum(np.less(s, 0)): */ __pyx_t_3 = __Pyx_GetModuleGlobalName (__pyx_n_s__np); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_3); __pyx_t_1 = __Pyx_ PyObject_GetAttrStr (__pyx_t_3, __pyx_n_s__mean); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_1); __Pyx_DECREF (__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyTuple_New (1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_3); __Pyx_INCREF (((PyObject *)__pyx_v_vertex)); PyTuple_SET_ITEM (__pyx_t_3, 0, ((PyObject *)__pyx_v_vertex)); __Pyx_GIVEREF (((PyObject *)__pyx_v_vertex)); __pyx_t_2 = PyObject_Call (__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_2); __Pyx_DECREF (__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF (((PyObject *)__pyx_t_3)); __pyx_t_3 = 0; __pyx_t_3 = PyObject_GetItem (__pyx_t_2, ((PyObject *)__pyx_k_tuple_15)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_3); __Pyx_DECREF (__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_Subtract (((PyObject *)__pyx_v_vertex), __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_2); __Pyx_DECREF (__pyx_t_3); __pyx_t_3 = 0; if (!(likely(((__pyx_t_2) == Py_None) || likely( __Pyx_TypeTest (__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_32 = ((PyArrayObject *)__pyx_t_2); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely( __Pyx_GetBufferAndValidate (&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_t_32, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { __pyx_v_v = ((PyArrayObject *)Py_None); __Pyx_INCREF (Py_None); __pyx_pybuffernd_v.rcbuffer->pybuffer.buf = NULL; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; } } __pyx_t_32 = 0; __pyx_v_v = ((PyArrayObject *)__pyx_t_2); __pyx_t_2 = 0; /* "_cython_magic_637c713b986c525e98b048fef3dc5c09.pyx":50 * * # enforce that the normal are outward * cdef np.ndarray[np.float64_t, ndim=2] v = vertex - np.mean(vertex)[..., None] # < < < < < < < < < < < < < < * cdef np.ndarray[np.float64_t, ndim=1] s = np.sum(v * normal, axis=1) * if np.sum(np.greater(s, 0)) < np.sum(np.less(s, 0)): */ __pyx_k_tuple_15 = PyTuple_Pack (2, Py_Ellipsis, Py_None); if (unlikely(!__pyx_k_tuple_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_k_tuple_15); __Pyx_GIVEREF (((PyObject *)__pyx_k_tuple_15));

51: cdef np.ndarray[np.float64_t, ndim=1] s = np.sum(v * normal, axis=1)

/* "_cython_magic_637c713b986c525e98b048fef3dc5c09.pyx":51 * # enforce that the normal are outward * cdef np.ndarray[np.float64_t, ndim=2] v = vertex - np.mean(vertex)[..., None] * cdef np.ndarray[np.float64_t, ndim=1] s = np.sum(v * normal, axis=1) # < < < < < < < < < < < < < < * if np.sum(np.greater(s, 0)) < np.sum(np.less(s, 0)): * # flip */ __pyx_t_2 = __Pyx_GetModuleGlobalName (__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_2); __pyx_t_3 = __Pyx_ PyObject_GetAttrStr (__pyx_t_2, __pyx_n_s__sum); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_3); __Pyx_DECREF (__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyNumber_Multiply (((PyObject *)__pyx_v_v), ((PyObject *)__pyx_v_normal)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_2); __pyx_t_1 = PyTuple_New (1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_1); PyTuple_SET_ITEM (__pyx_t_1, 0, __pyx_t_2); __Pyx_GIVEREF (__pyx_t_2); __pyx_t_2 = 0; __pyx_t_2 = PyDict_New (); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (((PyObject *)__pyx_t_2)); if ( PyDict_SetItem (__pyx_t_2, ((PyObject *)__pyx_n_s__axis), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_33 = PyObject_Call (__pyx_t_3, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_33); __Pyx_DECREF (__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF (((PyObject *)__pyx_t_1)); __pyx_t_1 = 0; __Pyx_DECREF (((PyObject *)__pyx_t_2)); __pyx_t_2 = 0; if (!(likely(((__pyx_t_33) == Py_None) || likely( __Pyx_TypeTest (__pyx_t_33, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_34 = ((PyArrayObject *)__pyx_t_33); { __Pyx_BufFmt_StackElem __pyx_stack[1]; if (unlikely( __Pyx_GetBufferAndValidate (&__pyx_pybuffernd_s.rcbuffer->pybuffer, (PyObject*)__pyx_t_34, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) { __pyx_v_s = ((PyArrayObject *)Py_None); __Pyx_INCREF (Py_None); __pyx_pybuffernd_s.rcbuffer->pybuffer.buf = NULL; {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } else {__pyx_pybuffernd_s.diminfo[0].strides = __pyx_pybuffernd_s.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_s.diminfo[0].shape = __pyx_pybuffernd_s.rcbuffer->pybuffer.shape[0]; } } __pyx_t_34 = 0; __pyx_v_s = ((PyArrayObject *)__pyx_t_33); __pyx_t_33 = 0;

52: if np.sum(np.greater(s, 0)) < np.sum(np.less(s, 0)):

/* "_cython_magic_637c713b986c525e98b048fef3dc5c09.pyx":52 * cdef np.ndarray[np.float64_t, ndim=2] v = vertex - np.mean(vertex)[..., None] * cdef np.ndarray[np.float64_t, ndim=1] s = np.sum(v * normal, axis=1) * if np.sum(np.greater(s, 0)) < np.sum(np.less(s, 0)): # < < < < < < < < < < < < < < * # flip * normal = -normal */ __pyx_t_33 = __Pyx_GetModuleGlobalName (__pyx_n_s__np); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_33); __pyx_t_2 = __Pyx_ PyObject_GetAttrStr (__pyx_t_33, __pyx_n_s__sum); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_2); __Pyx_DECREF (__pyx_t_33); __pyx_t_33 = 0; __pyx_t_33 = __Pyx_GetModuleGlobalName (__pyx_n_s__np); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_33); __pyx_t_1 = __Pyx_ PyObject_GetAttrStr (__pyx_t_33, __pyx_n_s__greater); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_1); __Pyx_DECREF (__pyx_t_33); __pyx_t_33 = 0; __pyx_t_33 = PyTuple_New (2); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_33); __Pyx_INCREF (((PyObject *)__pyx_v_s)); PyTuple_SET_ITEM (__pyx_t_33, 0, ((PyObject *)__pyx_v_s)); __Pyx_GIVEREF (((PyObject *)__pyx_v_s)); __Pyx_INCREF (__pyx_int_0); PyTuple_SET_ITEM (__pyx_t_33, 1, __pyx_int_0); __Pyx_GIVEREF (__pyx_int_0); __pyx_t_3 = PyObject_Call (__pyx_t_1, ((PyObject *)__pyx_t_33), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_3); __Pyx_DECREF (__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF (((PyObject *)__pyx_t_33)); __pyx_t_33 = 0; __pyx_t_33 = PyTuple_New (1); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_33); PyTuple_SET_ITEM (__pyx_t_33, 0, __pyx_t_3); __Pyx_GIVEREF (__pyx_t_3); __pyx_t_3 = 0; __pyx_t_3 = PyObject_Call (__pyx_t_2, ((PyObject *)__pyx_t_33), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_3); __Pyx_DECREF (__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF (((PyObject *)__pyx_t_33)); __pyx_t_33 = 0; __pyx_t_33 = __Pyx_GetModuleGlobalName (__pyx_n_s__np); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_33); __pyx_t_2 = __Pyx_ PyObject_GetAttrStr (__pyx_t_33, __pyx_n_s__sum); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_2); __Pyx_DECREF (__pyx_t_33); __pyx_t_33 = 0; __pyx_t_33 = __Pyx_GetModuleGlobalName (__pyx_n_s__np); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_33); __pyx_t_1 = __Pyx_ PyObject_GetAttrStr (__pyx_t_33, __pyx_n_s__less); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_1); __Pyx_DECREF (__pyx_t_33); __pyx_t_33 = 0; __pyx_t_33 = PyTuple_New (2); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_33); __Pyx_INCREF (((PyObject *)__pyx_v_s)); PyTuple_SET_ITEM (__pyx_t_33, 0, ((PyObject *)__pyx_v_s)); __Pyx_GIVEREF (((PyObject *)__pyx_v_s)); __Pyx_INCREF (__pyx_int_0); PyTuple_SET_ITEM (__pyx_t_33, 1, __pyx_int_0); __Pyx_GIVEREF (__pyx_int_0); __pyx_t_35 = PyObject_Call (__pyx_t_1, ((PyObject *)__pyx_t_33), NULL); if (unlikely(!__pyx_t_35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_35); __Pyx_DECREF (__pyx_t_1); __pyx_t_1 = 0; __Pyx_DECREF (((PyObject *)__pyx_t_33)); __pyx_t_33 = 0; __pyx_t_33 = PyTuple_New (1); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_33); PyTuple_SET_ITEM (__pyx_t_33, 0, __pyx_t_35); __Pyx_GIVEREF (__pyx_t_35); __pyx_t_35 = 0; __pyx_t_35 = PyObject_Call (__pyx_t_2, ((PyObject *)__pyx_t_33), NULL); if (unlikely(!__pyx_t_35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_35); __Pyx_DECREF (__pyx_t_2); __pyx_t_2 = 0; __Pyx_DECREF (((PyObject *)__pyx_t_33)); __pyx_t_33 = 0; __pyx_t_33 = PyObject_RichCompare (__pyx_t_3, __pyx_t_35, Py_LT); __Pyx_XGOTREF (__pyx_t_33); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF (__pyx_t_3); __pyx_t_3 = 0; __Pyx_DECREF (__pyx_t_35); __pyx_t_35 = 0; __pyx_t_36 = __Pyx_ PyObject_IsTrue (__pyx_t_33); if (unlikely(__pyx_t_36 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_DECREF (__pyx_t_33); __pyx_t_33 = 0; if (__pyx_t_36) {

53: # flip

54: normal = -normal

/* "_cython_magic_637c713b986c525e98b048fef3dc5c09.pyx":54 * if np.sum(np.greater(s, 0)) < np.sum(np.less(s, 0)): * # flip * normal = -normal # < < < < < < < < < < < < < < * normalf = -normalf * */ __pyx_t_33 = PyNumber_Negative (((PyObject *)__pyx_v_normal)); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_33); if (!(likely(((__pyx_t_33) == Py_None) || likely( __Pyx_TypeTest (__pyx_t_33, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_10 = ((PyArrayObject *)__pyx_t_33); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer (&__pyx_pybuffernd_normal.rcbuffer->pybuffer); __pyx_t_6 = __Pyx_GetBufferAndValidate (&__pyx_pybuffernd_normal.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack); if (unlikely(__pyx_t_6 < 0)) { PyErr_Fetch (&__pyx_t_7, &__pyx_t_8, &__pyx_t_9); if (unlikely( __Pyx_GetBufferAndValidate (&__pyx_pybuffernd_normal.rcbuffer->pybuffer, (PyObject*)__pyx_v_normal, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_7); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_9); __Pyx_RaiseBufferFallbackError (); } else { PyErr_Restore (__pyx_t_7, __pyx_t_8, __pyx_t_9); } } __pyx_pybuffernd_normal.diminfo[0].strides = __pyx_pybuffernd_normal.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_normal.diminfo[0].shape = __pyx_pybuffernd_normal.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_normal.diminfo[1].strides = __pyx_pybuffernd_normal.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_normal.diminfo[1].shape = __pyx_pybuffernd_normal.rcbuffer->pybuffer.shape[1]; if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_10 = 0; __Pyx_DECREF (((PyObject *)__pyx_v_normal)); __pyx_v_normal = ((PyArrayObject *)__pyx_t_33); __pyx_t_33 = 0;

55: normalf = -normalf

/* "_cython_magic_637c713b986c525e98b048fef3dc5c09.pyx":55 * # flip * normal = -normal * normalf = -normalf # < < < < < < < < < < < < < < * * return normal, normalf */ __pyx_t_33 = PyNumber_Negative (((PyObject *)__pyx_v_normalf)); if (unlikely(!__pyx_t_33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __Pyx_GOTREF (__pyx_t_33); if (!(likely(((__pyx_t_33) == Py_None) || likely( __Pyx_TypeTest (__pyx_t_33, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} __pyx_t_37 = ((PyArrayObject *)__pyx_t_33); { __Pyx_BufFmt_StackElem __pyx_stack[1]; __Pyx_SafeReleaseBuffer (&__pyx_pybuffernd_normalf.rcbuffer->pybuffer); __pyx_t_6 = __Pyx_GetBufferAndValidate (&__pyx_pybuffernd_normalf.rcbuffer->pybuffer, (PyObject*)__pyx_t_37, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack); if (unlikely(__pyx_t_6 < 0)) { PyErr_Fetch (&__pyx_t_9, &__pyx_t_8, &__pyx_t_7); if (unlikely( __Pyx_GetBufferAndValidate (&__pyx_pybuffernd_normalf.rcbuffer->pybuffer, (PyObject*)__pyx_v_normalf, &__Pyx_TypeInfo_nn___pyx_t_5numpy_float64_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) { Py_XDECREF(__pyx_t_9); Py_XDECREF(__pyx_t_8); Py_XDECREF(__pyx_t_7); __Pyx_RaiseBufferFallbackError (); } else { PyErr_Restore (__pyx_t_9, __pyx_t_8, __pyx_t_7); } } __pyx_pybuffernd_normalf.diminfo[0].strides = __pyx_pybuffernd_normalf.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_normalf.diminfo[0].shape = __pyx_pybuffernd_normalf.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_normalf.diminfo[1].strides = __pyx_pybuffernd_normalf.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_normalf.diminfo[1].shape = __pyx_pybuffernd_normalf.rcbuffer->pybuffer.shape[1]; if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} } __pyx_t_37 = 0; __Pyx_DECREF (((PyObject *)__pyx_v_normalf)); __pyx_v_normalf = ((PyArrayObject *)__pyx_t_33); __pyx_t_33 = 0; goto __pyx_L7; } __pyx_L7:;

56:

57: return normal, normalf