/* Generated by Cython 0.23.4 */

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
    #error Cython requires Python 2.6+ or Python 3.2+.
#else
#define CYTHON_ABI "0_23_4"
#include <stddef.h>
#ifndef offsetof
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
#define CYTHON_COMPILING_IN_PYPY 1
#define CYTHON_COMPILING_IN_CPYTHON 0
#else
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_CPYTHON 1
#endif
#if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000
#define CYTHON_USE_PYLONG_INTERNALS 1
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
#define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyClass_Type
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyType_Type
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
  #define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
#else
  #define CYTHON_PEP393_ENABLED 0
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
  #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
#endif
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
#else
  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  #define PyNumber_Int                 PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  #ifndef PyUnicode_InternFromString
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  #endif
#endif
#if PY_VERSION_HEX < 0x030200A4
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#else
  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#if PY_VERSION_HEX >= 0x030500B1
#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
#elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
typedef struct {
    unaryfunc am_await;
    unaryfunc am_aiter;
    unaryfunc am_anext;
} __Pyx_PyAsyncMethodsStruct;
#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
#else
#define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef CYTHON_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)

#ifndef __cplusplus
  #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
#endif
#ifndef CYTHON_INLINE
  #define CYTHON_INLINE inline
#endif
template<typename T>
void __Pyx_call_destructor(T& x) {
    x.~T();
}
template<typename T>
class __Pyx_FakeReference {
  public:
    __Pyx_FakeReference() : ptr(NULL) { }
    __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
    T *operator->() { return ptr; }
    operator T&() { return *ptr; }
  private:
    T *ptr;
};

#if defined(WIN32) || defined(MS_WINDOWS)
  #define _USE_MATH_DEFINES
#endif
#include <math.h>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
  float value;
  memset(&value, 0xFF, sizeof(value));
  return value;
}
#endif


#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif

#ifndef __PYX_EXTERN_C
  #ifdef __cplusplus
    #define __PYX_EXTERN_C extern "C"
  #else
    #define __PYX_EXTERN_C extern
  #endif
#endif

#define __PYX_HAVE__pyclipper
#define __PYX_HAVE_API__pyclipper
#include "stdio.h"
#include "stdlib.h"
#include <vector>
#include "ios"
#include "new"
#include "stdexcept"
#include "typeinfo"
#include "extra_defines.hpp"
#include "clipper.hpp"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif

#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;

#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
    (sizeof(type) < sizeof(Py_ssize_t))  ||\
    (sizeof(type) > sizeof(Py_ssize_t) &&\
          likely(v < (type)PY_SSIZE_T_MAX ||\
                 v == (type)PY_SSIZE_T_MAX)  &&\
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
                                v == (type)PY_SSIZE_T_MIN)))  ||\
    (sizeof(type) == sizeof(Py_ssize_t) &&\
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
                               v == (type)PY_SSIZE_T_MAX)))  )
#if defined (__cplusplus) && __cplusplus >= 201103L
    #include <cstdlib>
    #define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) labs(value)
#elif defined (_MSC_VER) && defined (_M_X64)
    #define __Pyx_sst_abs(value) _abs64(value)
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define __Pyx_sst_abs(value) llabs(value)
#elif defined (__GNUC__)
    #define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
    #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if PY_MAJOR_VERSION < 3
    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#endif
#define __Pyx_PyObject_AsSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#if PY_MAJOR_VERSION < 3
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
{
    const Py_UNICODE *u_end = u;
    while (*u_end++) ;
    return (size_t)(u_end - u - 1);
}
#else
#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
#endif
#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
#if CYTHON_COMPILING_IN_CPYTHON
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    PyObject* ascii_chars_u = NULL;
    PyObject* ascii_chars_b = NULL;
    const char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    if (strcmp(default_encoding_c, "ascii") == 0) {
        __Pyx_sys_getdefaultencoding_not_ascii = 0;
    } else {
        char ascii_chars[128];
        int c;
        for (c = 0; c < 128; c++) {
            ascii_chars[c] = c;
        }
        __Pyx_sys_getdefaultencoding_not_ascii = 1;
        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
        if (!ascii_chars_u) goto bad;
        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
        if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
            PyErr_Format(
                PyExc_ValueError,
                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
                default_encoding_c);
            goto bad;
        }
        Py_DECREF(ascii_chars_u);
        Py_DECREF(ascii_chars_b);
    }
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    Py_XDECREF(ascii_chars_u);
    Py_XDECREF(ascii_chars_b);
    return -1;
}
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#else
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
static char* __PYX_DEFAULT_STRING_ENCODING;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
    if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    return -1;
}
#endif
#endif


/* Test for GCC > 2.95 */
#if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  #define likely(x)   __builtin_expect(!!(x), 1)
  #define unlikely(x) __builtin_expect(!!(x), 0)
#else /* !__GNUC__ or GCC < 2.95 */
  #define likely(x)   (x)
  #define unlikely(x) (x)
#endif /* __GNUC__ */

static PyObject *__pyx_m;
static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;


static const char *__pyx_f[] = {
  "pyclipper/pyclipper.pyx",
};

/*--- Type declarations ---*/
struct __pyx_obj_9pyclipper_Pyclipper;
struct __pyx_obj_9pyclipper_PyclipperOffset;
struct __pyx_obj_9pyclipper___pyx_scope_struct__scale_to_clipper;
struct __pyx_obj_9pyclipper___pyx_scope_struct_1_scale_from_clipper;
struct __pyx_opt_args_9pyclipper__filter_polynode;

/* "pyclipper.pyx":834
 * 
 * 
 * cdef _filter_polynode(pypolynode, result, filter_func=None):             # <<<<<<<<<<<<<<
 *     if (filter_func is None or filter_func(pypolynode)) and len(pypolynode.Contour) > 0:
 *         result.append(pypolynode.Contour)
 */
struct __pyx_opt_args_9pyclipper__filter_polynode {
  int __pyx_n;
  PyObject *filter_func;
};

/* "pyclipper.pyx":564
 * 
 * 
 * cdef class Pyclipper:             # <<<<<<<<<<<<<<
 * 
 *     """Wraps the Clipper class.
 */
struct __pyx_obj_9pyclipper_Pyclipper {
  PyObject_HEAD
  ClipperLib::Clipper *thisptr;
};


/* "pyclipper.pyx":723
 * 
 * 
 * cdef class PyclipperOffset:             # <<<<<<<<<<<<<<
 *     """ Wraps the ClipperOffset class.
 * 
 */
struct __pyx_obj_9pyclipper_PyclipperOffset {
  PyObject_HEAD
  ClipperLib::ClipperOffset *thisptr;
};


/* "pyclipper.pyx":516
 * 
 * 
 * def scale_to_clipper(path_or_paths, scale = 2 ** 31):             # <<<<<<<<<<<<<<
 *     """
 *     Take a path or list of paths with coordinates represented by floats and scale them using the specified factor. This function can be user to convert paths to a representation which is more appropriate for Clipper.
 */
struct __pyx_obj_9pyclipper___pyx_scope_struct__scale_to_clipper {
  PyObject_HEAD
  PyObject *__pyx_v_scale;
  PyObject *__pyx_v_scale_value;
};


/* "pyclipper.pyx":547
 * 
 * 
 * def scale_from_clipper(path_or_paths, scale = 2 ** 31):             # <<<<<<<<<<<<<<
 *     """
 *     Take a path or list of paths with coordinates represented by ints and scale them back to a fractional representation. This function does the inverse of `scale_to_clipper()`.
 */
struct __pyx_obj_9pyclipper___pyx_scope_struct_1_scale_from_clipper {
  PyObject_HEAD
  PyObject *__pyx_v_scale;
  PyObject *__pyx_v_scale_value;
};


/* --- Runtime support code (head) --- */
#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, int);
    void (*DECREF)(void*, PyObject*, int);
    void (*GOTREF)(void*, PyObject*, int);
    void (*GIVEREF)(void*, PyObject*, int);
    void* (*SetupContext)(const char*, int, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
#ifdef WITH_THREAD
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          if (acquire_gil) {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
              PyGILState_Release(__pyx_gilstate_save);\
          } else {\
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
          }
#else
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
  #define __Pyx_RefNannyFinishContext()\
          __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
#else
  #define __Pyx_RefNannyDeclarations
  #define __Pyx_RefNannySetupContext(name, acquire_gil)
  #define __Pyx_RefNannyFinishContext()
  #define __Pyx_INCREF(r) Py_INCREF(r)
  #define __Pyx_DECREF(r) Py_DECREF(r)
  #define __Pyx_GOTREF(r)
  #define __Pyx_GIVEREF(r)
  #define __Pyx_XINCREF(r) Py_XINCREF(r)
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
  #define __Pyx_XGOTREF(r)
  #define __Pyx_XGIVEREF(r)
#endif
#define __Pyx_XDECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_XDECREF(tmp);\
    } while (0)
#define __Pyx_DECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_DECREF(tmp);\
    } while (0)
#define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
#define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif

static PyObject *__Pyx_GetBuiltinName(PyObject *name);

static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);

#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL)
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_setattro))
        return tp->tp_setattro(obj, attr_name, value);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_setattr))
        return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
#endif
    return PyObject_SetAttr(obj, attr_name, value);
}
#else
#define __Pyx_PyObject_DelAttrStr(o,n)   PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif

static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);

static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);

static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
    PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
    const char* function_name);

static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);

#define __Pyx_CyFunction_USED 1
#include <structmember.h>
#define __Pyx_CYFUNCTION_STATICMETHOD  0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD   0x02
#define __Pyx_CYFUNCTION_CCLASS        0x04
#define __Pyx_CyFunction_GetClosure(f)\
    (((__pyx_CyFunctionObject *) (f))->func_closure)
#define __Pyx_CyFunction_GetClassObj(f)\
    (((__pyx_CyFunctionObject *) (f))->func_classobj)
#define __Pyx_CyFunction_Defaults(type, f)\
    ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
    ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
typedef struct {
    PyCFunctionObject func;
#if PY_VERSION_HEX < 0x030500A0
    PyObject *func_weakreflist;
#endif
    PyObject *func_dict;
    PyObject *func_name;
    PyObject *func_qualname;
    PyObject *func_doc;
    PyObject *func_globals;
    PyObject *func_code;
    PyObject *func_closure;
    PyObject *func_classobj;
    void *defaults;
    int defaults_pyobjects;
    int flags;
    PyObject *defaults_tuple;
    PyObject *defaults_kwdict;
    PyObject *(*defaults_getter)(PyObject *);
    PyObject *func_annotations;
} __pyx_CyFunctionObject;
static PyTypeObject *__pyx_CyFunctionType = 0;
#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\
    __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *self,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
                                                         size_t size,
                                                         int pyobjects);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
                                                            PyObject *tuple);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
                                                             PyObject *dict);
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
                                                              PyObject *dict);
static int __pyx_CyFunction_init(void);

static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len)) {
        Py_INCREF(x);
        PyList_SET_ITEM(list, len, x);
        Py_SIZE(list) = len+1;
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
#endif

static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);

static void __Pyx_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename,
                                  int full_traceback, int nogil);

static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif

static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
#else
#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
        Py_INCREF(x);
        PyList_SET_ITEM(list, len, x);
        Py_SIZE(list) = len+1;
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif

static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);

static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x);

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
#else
#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\
    (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#endif

#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
    (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
               __Pyx_GetItemInt_Generic(o, to_py_func(i))))
#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                     int is_list, int wraparound, int boundscheck);

#include <string.h>

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);

static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);

static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
                                           PyObject *mkw, PyObject *modname, PyObject *doc);
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
                                      PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);

static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);

typedef struct {
    int code_line;
    PyCodeObject* code_object;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
    int count;
    int max_count;
    __Pyx_CodeObjectCacheEntry* entries;
};
static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);

static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__ClipperLib_3a__3a_JoinType(enum ClipperLib::JoinType value);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__ClipperLib_3a__3a_EndType(enum ClipperLib::EndType value);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__ClipperLib_3a__3a_ClipType(enum ClipperLib::ClipType value);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__ClipperLib_3a__3a_PolyType(enum ClipperLib::PolyType value);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__ClipperLib_3a__3a_PolyFillType(enum ClipperLib::PolyFillType value);

static CYTHON_INLINE enum ClipperLib::PolyFillType __Pyx_PyInt_As_enum__ClipperLib_3a__3a_PolyFillType(PyObject *);

static CYTHON_INLINE enum ClipperLib::PolyType __Pyx_PyInt_As_enum__ClipperLib_3a__3a_PolyType(PyObject *);

static CYTHON_INLINE enum ClipperLib::ClipType __Pyx_PyInt_As_enum__ClipperLib_3a__3a_ClipType(PyObject *);

static CYTHON_INLINE enum ClipperLib::JoinType __Pyx_PyInt_As_enum__ClipperLib_3a__3a_JoinType(PyObject *);

static CYTHON_INLINE enum ClipperLib::EndType __Pyx_PyInt_As_enum__ClipperLib_3a__3a_EndType(PyObject *);

static int __Pyx_Print(PyObject*, PyObject *, int);
#if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3
static PyObject* __pyx_print = 0;
static PyObject* __pyx_print_kwargs = 0;
#endif

static int __Pyx_PrintOne(PyObject* stream, PyObject *o);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);

static CYTHON_INLINE ClipperLib::cInt __Pyx_PyInt_As_ClipperLib_3a__3a_cInt(PyObject *);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ClipperLib_3a__3a_cInt(ClipperLib::cInt value);

static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);

static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);

static int __Pyx_check_binary_version(void);

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);


/* Module declarations from 'libcpp.vector' */

/* Module declarations from 'pyclipper' */
static PyTypeObject *__pyx_ptype_9pyclipper_Pyclipper = 0;
static PyTypeObject *__pyx_ptype_9pyclipper_PyclipperOffset = 0;
static PyTypeObject *__pyx_ptype_9pyclipper___pyx_scope_struct__scale_to_clipper = 0;
static PyTypeObject *__pyx_ptype_9pyclipper___pyx_scope_struct_1_scale_from_clipper = 0;
static PyObject *__pyx_f_9pyclipper__filter_polynode(PyObject *, PyObject *, struct __pyx_opt_args_9pyclipper__filter_polynode *__pyx_optional_args); /*proto*/
static PyObject *__pyx_f_9pyclipper__from_poly_tree(ClipperLib::PolyTree &); /*proto*/
static PyObject *__pyx_f_9pyclipper__node_walk(ClipperLib::PolyNode *, PyObject *); /*proto*/
static ClipperLib::Paths __pyx_f_9pyclipper__to_clipper_paths(PyObject *); /*proto*/
static ClipperLib::Path __pyx_f_9pyclipper__to_clipper_path(PyObject *); /*proto*/
static struct ClipperLib::IntPoint __pyx_f_9pyclipper__to_clipper_point(PyObject *); /*proto*/
static PyObject *__pyx_f_9pyclipper__from_clipper_paths(ClipperLib::Paths); /*proto*/
static PyObject *__pyx_f_9pyclipper__from_clipper_path(ClipperLib::Path); /*proto*/
#define __Pyx_MODULE_NAME "pyclipper"
int __pyx_module_is_main_pyclipper = 0;

/* Implementation of 'pyclipper' */
static PyObject *__pyx_builtin_Exception;
static PyObject *__pyx_builtin_xrange;
static PyObject *__pyx_builtin_max;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_DeprecationWarning;
static char __pyx_k_X[] = "X";
static char __pyx_k_Y[] = "Y";
static char __pyx_k_i[] = "i";
static char __pyx_k_x[] = "x";
static char __pyx_k_doc[] = "__doc__";
static char __pyx_k_end[] = "end";
static char __pyx_k_max[] = "max";
static char __pyx_k_sys[] = "sys";
static char __pyx_k_top[] = "top";
static char __pyx_k_Area[] = "Area";
static char __pyx_k_Real[] = "Real";
static char __pyx_k_copy[] = "copy";
static char __pyx_k_file[] = "file";
static char __pyx_k_init[] = "__init__";
static char __pyx_k_left[] = "left";
static char __pyx_k_main[] = "__main__";
static char __pyx_k_path[] = "path";
static char __pyx_k_poly[] = "poly";
static char __pyx_k_self[] = "self";
static char __pyx_k_test[] = "__test__";
static char __pyx_k_time[] = "time";
static char __pyx_k_warn[] = "warn";
static char __pyx_k_depth[] = "depth";
static char __pyx_k_paths[] = "paths";
static char __pyx_k_point[] = "point";
static char __pyx_k_poly1[] = "poly1";
static char __pyx_k_poly2[] = "poly2";
static char __pyx_k_polys[] = "polys";
static char __pyx_k_print[] = "print";
static char __pyx_k_range[] = "range";
static char __pyx_k_right[] = "right";
static char __pyx_k_scale[] = "scale";
static char __pyx_k_sys_2[] = "_sys";
static char __pyx_k_CT_XOR[] = "CT_XOR";
static char __pyx_k_Childs[] = "Childs";
static char __pyx_k_IsHole[] = "IsHole";
static char __pyx_k_IsOpen[] = "IsOpen";
static char __pyx_k_Parent[] = "Parent";
static char __pyx_k_SILENT[] = "SILENT";
static char __pyx_k_append[] = "append";
static char __pyx_k_bottom[] = "bottom";
static char __pyx_k_c_path[] = "c_path";
static char __pyx_k_closed[] = "closed";
static char __pyx_k_copy_2[] = "_copy";
static char __pyx_k_import[] = "__import__";
static char __pyx_k_module[] = "__module__";
static char __pyx_k_struct[] = "struct";
static char __pyx_k_time_2[] = "_time";
static char __pyx_k_xrange[] = "xrange";
static char __pyx_k_Contour[] = "Contour";
static char __pyx_k_PT_CLIP[] = "PT_CLIP";
static char __pyx_k_c_paths[] = "c_paths";
static char __pyx_k_numbers[] = "_numbers";
static char __pyx_k_pattern[] = "pattern";
static char __pyx_k_prepare[] = "__prepare__";
static char __pyx_k_CT_UNION[] = "CT_UNION";
static char __pyx_k_JT_MITER[] = "JT_MITER";
static char __pyx_k_JT_ROUND[] = "JT_ROUND";
static char __pyx_k_distance[] = "distance";
static char __pyx_k_end_type[] = "end_type";
static char __pyx_k_out_poly[] = "out_poly";
static char __pyx_k_qualname[] = "__qualname__";
static char __pyx_k_solution[] = "solution";
static char __pyx_k_warnings[] = "_warnings";
static char __pyx_k_Exception[] = "Exception";
static char __pyx_k_JT_SQUARE[] = "JT_SQUARE";
static char __pyx_k_PyIntRect[] = "PyIntRect";
static char __pyx_k_clip_type[] = "clip_type";
static char __pyx_k_fill_type[] = "fill_type";
static char __pyx_k_join_type[] = "join_type";
static char __pyx_k_metaclass[] = "__metaclass__";
static char __pyx_k_numbers_2[] = "numbers";
static char __pyx_k_out_polys[] = "out_polys";
static char __pyx_k_poly_node[] = "poly_node";
static char __pyx_k_poly_type[] = "poly_type";
static char __pyx_k_pyclipper[] = "pyclipper";
static char __pyx_k_MiterLimit[] = "MiterLimit";
static char __pyx_k_PT_SUBJECT[] = "PT_SUBJECT";
static char __pyx_k_PyPolyNode[] = "PyPolyNode";
static char __pyx_k_log_action[] = "log_action";
static char __pyx_k_namedtuple[] = "namedtuple";
static char __pyx_k_warnings_2[] = "warnings";
static char __pyx_k_ET_OPENBUTT[] = "ET_OPENBUTT";
static char __pyx_k_Orientation[] = "Orientation";
static char __pyx_k_PFT_EVENODD[] = "PFT_EVENODD";
static char __pyx_k_PFT_NONZERO[] = "PFT_NONZERO";
static char __pyx_k_ReversePath[] = "ReversePath";
static char __pyx_k_collections[] = "collections";
static char __pyx_k_description[] = "description";
static char __pyx_k_miter_limit[] = "miter_limit";
static char __pyx_k_scale_value[] = "scale_value";
static char __pyx_k_unicodedata[] = "unicodedata";
static char __pyx_k_ArcTolerance[] = "ArcTolerance";
static char __pyx_k_CleanPolygon[] = "CleanPolygon";
static char __pyx_k_ET_OPENROUND[] = "ET_OPENROUND";
static char __pyx_k_MinkowskiSum[] = "MinkowskiSum";
static char __pyx_k_PFT_NEGATIVE[] = "PFT_NEGATIVE";
static char __pyx_k_PFT_POSITIVE[] = "PFT_POSITIVE";
static char __pyx_k_ReversePaths[] = "ReversePaths";
static char __pyx_k_CT_DIFFERENCE[] = "CT_DIFFERENCE";
static char __pyx_k_CleanPolygons[] = "CleanPolygons";
static char __pyx_k_ET_CLOSEDLINE[] = "ET_CLOSEDLINE";
static char __pyx_k_ET_OPENSQUARE[] = "ET_OPENSQUARE";
static char __pyx_k_MinkowskiDiff[] = "MinkowskiDiff";
static char __pyx_k_MinkowskiSum2[] = "MinkowskiSum2";
static char __pyx_k_arc_tolerance[] = "arc_tolerance";
static char __pyx_k_path_or_paths[] = "path_or_paths";
static char __pyx_k_unicodedata_2[] = "_unicodedata";
static char __pyx_k_PointInPolygon[] = "PointInPolygon";
static char __pyx_k_SCALING_FACTOR[] = "SCALING_FACTOR";
static char __pyx_k_clip_fill_type[] = "clip_fill_type";
static char __pyx_k_path_is_closed[] = "path_is_closed";
static char __pyx_k_subj_fill_type[] = "subj_fill_type";
static char __pyx_k_CT_INTERSECTION[] = "CT_INTERSECTION";
static char __pyx_k_PolyTreeToPaths[] = "PolyTreeToPaths";
static char __pyx_k_SimplifyPolygon[] = "SimplifyPolygon";
static char __pyx_k_ClipperException[] = "ClipperException";
static char __pyx_k_ET_CLOSEDPOLYGON[] = "ET_CLOSEDPOLYGON";
static char __pyx_k_SimplifyPolygons[] = "SimplifyPolygons";
static char __pyx_k_scale_to_clipper[] = "scale_to_clipper";
static char __pyx_k_PyPolyNode___init[] = "PyPolyNode.__init__";
static char __pyx_k_DeprecationWarning[] = "DeprecationWarning";
static char __pyx_k_scale_from_clipper[] = "scale_from_clipper";
static char __pyx_k_check_scaling_factor[] = "_check_scaling_factor";
static char __pyx_k_OpenPathsFromPolyTree[] = "OpenPathsFromPolyTree";
static char __pyx_k_ClosedPathsFromPolyTree[] = "ClosedPathsFromPolyTree";
static char __pyx_k_scale_to_clipper_line_516[] = "scale_to_clipper (line 516)";
static char __pyx_k_Creating_a_Clipper_instance[] = "Creating a Clipper instance";
static char __pyx_k_Deleting_the_Clipper_instance[] = "Deleting the Clipper instance";
static char __pyx_k_Maximum_acceptable_imprecision[] = " Maximum acceptable imprecision when arcs are approximated in\n        an offsetting operation.\n\n        More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Properties/ArcTolerance.htm\n        ";
static char __pyx_k_Python_binding_clipper_library[] = "Python binding clipper library";
static char __pyx_k_Cython_wrapper_for_the_C_transl[] = "\nCython wrapper for the C++ translation of the Angus Johnson's Clipper\nlibrary (ver. 6.2.1) (http://www.angusj.com/delphi/clipper.php)\n\nThis wrapper was written by Maxime Chalton, Lukas Treyer and Gregor Ratajc.\n\n";
static char __pyx_k_Maximum_distance_in_multiples_o[] = " Maximum distance in multiples of delta that vertices can be offset from their\n        original positions.\n\n        More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Properties/MiterLimit.htm\n        ";
static char __pyx_k_Represents_ClipperLibs_PolyTree[] = "\n    Represents ClipperLibs' PolyTree and PolyNode data structures.\n    ";
static char __pyx_k_Should_clipper_preserve_colline[] = " Should clipper preserve collinear vertices.\n        More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/Clipper/Properties/PreserveCollinear.htm\n        ";
static char __pyx_k_Should_polygons_returned_from_E[] = " Should polygons returned from Execute/Execute2 have their orientations\n        opposite to their normal orientations.\n        More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/Clipper/Properties/ReverseSolution.htm\n        ";
static char __pyx_k_Take_a_path_or_list_of_paths_wi[] = "\n    Take a path or list of paths with coordinates represented by floats and scale them using the specified factor. This function can be user to convert paths to a representation which is more appropriate for Clipper.\n    \n    Clipper, and thus Pyclipper, uses 64-bit integers to represent coordinates internally. The actual supported range (+/- 2 ** 62) is a bit smaller than the maximal values for this type. To operate on paths which use fractional coordinates, it is necessary to translate them from and to a representation which does not depend on floats. This can be done using this function and it's reverse, `scale_from_clipper()`.\n    \n    For details, see http://www.angusj.com/delphi/clipper/documentation/Docs/Overview/Rounding.htm.\n    \n    For example, to perform a clip operation on two polygons, the arguments to `Pyclipper.AddPath()` need to be wrapped in `scale_to_clipper()` while the return value needs to be converted back with `scale_from_clipper()`:\n    \n    >>> pc = Pyclipper()\n    >>> path = [[0, 0], [1, 0], [1 / 2, (3 / 4) ** (1 / 2)]] # A triangle.\n    >>> clip = [[0, 1 / 3], [1, 1 / 3], [1, 2 / 3], [0, 1 / 3]] # A rectangle.\n    >>> pc.AddPath(scale_to_clipper(path), PT_SUBJECT)\n    >>> pc.AddPath(scale_to_clipper(clip), PT_CLIP)\n    >>> scale_from_clipper(pc.Execute(CT_INTERSECTION))\n    [[[0.6772190444171429, 0.5590730146504939], [0.2383135547861457, 0.41277118446305394], [0.19245008938014507, 0.3333333330228925], [0.8075499106198549, 0.3333333330228925]]]\n    \n    :param path_or_paths: Either a list of paths or a path. A path is a list of tuples of numbers.\n    :param scale: The factor with which to multiply coordinates before converting rounding them to ints. The default will give you a range of +/- 2 ** 31 with a precision of 2 ** -31.\n    ";
static char __pyx_k_home_gregor_work_priv_pyclipper[] = "/home/gregor/work/priv/pyclipper/pyclipper/pyclipper.pyx";
static char __pyx_k_scale_from_clipper_locals_scale[] = "scale_from_clipper.<locals>.scale_value";
static char __pyx_k_All_paths_are_invalid_for_clippi[] = "All paths are invalid for clipping";
static char __pyx_k_ClosedPathsFromPolyTree_locals_l[] = "ClosedPathsFromPolyTree.<locals>.<lambda>";
static char __pyx_k_Creating_an_ClipperOffset_instan[] = "Creating an ClipperOffset instance";
static char __pyx_k_Deleting_the_ClipperOffset_insta[] = "Deleting the ClipperOffset instance";
static char __pyx_k_Execution_of_clipper_did_not_suc[] = "Execution of clipper did not succeed!";
static char __pyx_k_OpenPathsFromPolyTree_locals_lam[] = "OpenPathsFromPolyTree.<locals>.<lambda>";
static char __pyx_k_SCALING_FACTOR_is_deprecated_and[] = "SCALING_FACTOR is deprecated and it's value is ignored. See https://github.com/greginvm/pyclipper/wiki/Deprecating-SCALING_FACTOR for more information.";
static char __pyx_k_The_path_is_invalid_for_clipping[] = "The path is invalid for clipping";
static char __pyx_k_scale_to_clipper_locals_scale_va[] = "scale_to_clipper.<locals>.scale_value";
static char __pyx_k_Should_polygons_returned_from_E_2[] = " Should polygons returned from Execute/Execute2 be strictly simple (True) or may be weakly simple (False).\n        More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/Clipper/Properties/StrictlySimple.htm\n        ";
static PyObject *__pyx_kp_s_All_paths_are_invalid_for_clippi;
static PyObject *__pyx_n_s_ArcTolerance;
static PyObject *__pyx_n_s_Area;
static PyObject *__pyx_n_s_CT_DIFFERENCE;
static PyObject *__pyx_n_s_CT_INTERSECTION;
static PyObject *__pyx_n_s_CT_UNION;
static PyObject *__pyx_n_s_CT_XOR;
static PyObject *__pyx_n_s_Childs;
static PyObject *__pyx_n_s_CleanPolygon;
static PyObject *__pyx_n_s_CleanPolygons;
static PyObject *__pyx_n_s_ClipperException;
static PyObject *__pyx_n_s_ClosedPathsFromPolyTree;
static PyObject *__pyx_n_s_ClosedPathsFromPolyTree_locals_l;
static PyObject *__pyx_n_s_Contour;
static PyObject *__pyx_kp_s_Creating_a_Clipper_instance;
static PyObject *__pyx_kp_s_Creating_an_ClipperOffset_instan;
static PyObject *__pyx_kp_s_Deleting_the_ClipperOffset_insta;
static PyObject *__pyx_kp_s_Deleting_the_Clipper_instance;
static PyObject *__pyx_n_s_DeprecationWarning;
static PyObject *__pyx_n_s_ET_CLOSEDLINE;
static PyObject *__pyx_n_s_ET_CLOSEDPOLYGON;
static PyObject *__pyx_n_s_ET_OPENBUTT;
static PyObject *__pyx_n_s_ET_OPENROUND;
static PyObject *__pyx_n_s_ET_OPENSQUARE;
static PyObject *__pyx_n_s_Exception;
static PyObject *__pyx_kp_s_Execution_of_clipper_did_not_suc;
static PyObject *__pyx_n_s_IsHole;
static PyObject *__pyx_n_s_IsOpen;
static PyObject *__pyx_n_s_JT_MITER;
static PyObject *__pyx_n_s_JT_ROUND;
static PyObject *__pyx_n_s_JT_SQUARE;
static PyObject *__pyx_n_s_MinkowskiDiff;
static PyObject *__pyx_n_s_MinkowskiSum;
static PyObject *__pyx_n_s_MinkowskiSum2;
static PyObject *__pyx_n_s_MiterLimit;
static PyObject *__pyx_n_s_OpenPathsFromPolyTree;
static PyObject *__pyx_n_s_OpenPathsFromPolyTree_locals_lam;
static PyObject *__pyx_n_s_Orientation;
static PyObject *__pyx_n_s_PFT_EVENODD;
static PyObject *__pyx_n_s_PFT_NEGATIVE;
static PyObject *__pyx_n_s_PFT_NONZERO;
static PyObject *__pyx_n_s_PFT_POSITIVE;
static PyObject *__pyx_n_s_PT_CLIP;
static PyObject *__pyx_n_s_PT_SUBJECT;
static PyObject *__pyx_n_s_Parent;
static PyObject *__pyx_n_s_PointInPolygon;
static PyObject *__pyx_n_s_PolyTreeToPaths;
static PyObject *__pyx_n_s_PyIntRect;
static PyObject *__pyx_n_s_PyPolyNode;
static PyObject *__pyx_n_s_PyPolyNode___init;
static PyObject *__pyx_kp_s_Python_binding_clipper_library;
static PyObject *__pyx_n_s_Real;
static PyObject *__pyx_kp_s_Represents_ClipperLibs_PolyTree;
static PyObject *__pyx_n_s_ReversePath;
static PyObject *__pyx_n_s_ReversePaths;
static PyObject *__pyx_n_s_SCALING_FACTOR;
static PyObject *__pyx_kp_s_SCALING_FACTOR_is_deprecated_and;
static PyObject *__pyx_n_s_SILENT;
static PyObject *__pyx_n_s_SimplifyPolygon;
static PyObject *__pyx_n_s_SimplifyPolygons;
static PyObject *__pyx_kp_u_Take_a_path_or_list_of_paths_wi;
static PyObject *__pyx_kp_s_The_path_is_invalid_for_clipping;
static PyObject *__pyx_n_s_X;
static PyObject *__pyx_n_s_Y;
static PyObject *__pyx_n_s_append;
static PyObject *__pyx_n_s_arc_tolerance;
static PyObject *__pyx_n_s_bottom;
static PyObject *__pyx_n_s_c_path;
static PyObject *__pyx_n_s_c_paths;
static PyObject *__pyx_n_s_check_scaling_factor;
static PyObject *__pyx_n_s_clip_fill_type;
static PyObject *__pyx_n_s_clip_type;
static PyObject *__pyx_n_s_closed;
static PyObject *__pyx_n_s_collections;
static PyObject *__pyx_n_s_copy;
static PyObject *__pyx_n_s_copy_2;
static PyObject *__pyx_n_s_depth;
static PyObject *__pyx_n_s_description;
static PyObject *__pyx_n_s_distance;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_s_end;
static PyObject *__pyx_n_s_end_type;
static PyObject *__pyx_n_s_file;
static PyObject *__pyx_n_s_fill_type;
static PyObject *__pyx_kp_s_home_gregor_work_priv_pyclipper;
static PyObject *__pyx_n_s_i;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_init;
static PyObject *__pyx_n_s_join_type;
static PyObject *__pyx_n_s_left;
static PyObject *__pyx_n_s_log_action;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_max;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_s_miter_limit;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_n_s_namedtuple;
static PyObject *__pyx_n_s_numbers;
static PyObject *__pyx_n_s_numbers_2;
static PyObject *__pyx_n_s_out_poly;
static PyObject *__pyx_n_s_out_polys;
static PyObject *__pyx_n_s_path;
static PyObject *__pyx_n_s_path_is_closed;
static PyObject *__pyx_n_s_path_or_paths;
static PyObject *__pyx_n_s_paths;
static PyObject *__pyx_n_s_pattern;
static PyObject *__pyx_n_s_point;
static PyObject *__pyx_n_s_poly;
static PyObject *__pyx_n_s_poly1;
static PyObject *__pyx_n_s_poly2;
static PyObject *__pyx_n_s_poly_node;
static PyObject *__pyx_n_s_poly_type;
static PyObject *__pyx_n_s_polys;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_n_s_print;
static PyObject *__pyx_n_s_pyclipper;
static PyObject *__pyx_n_s_qualname;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_right;
static PyObject *__pyx_n_s_scale;
static PyObject *__pyx_n_s_scale_from_clipper;
static PyObject *__pyx_n_s_scale_from_clipper_locals_scale;
static PyObject *__pyx_n_s_scale_to_clipper;
static PyObject *__pyx_kp_u_scale_to_clipper_line_516;
static PyObject *__pyx_n_s_scale_to_clipper_locals_scale_va;
static PyObject *__pyx_n_s_scale_value;
static PyObject *__pyx_n_s_self;
static PyObject *__pyx_n_s_solution;
static PyObject *__pyx_n_s_struct;
static PyObject *__pyx_n_s_subj_fill_type;
static PyObject *__pyx_n_s_sys;
static PyObject *__pyx_n_s_sys_2;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_time;
static PyObject *__pyx_n_s_time_2;
static PyObject *__pyx_n_s_top;
static PyObject *__pyx_n_s_unicodedata;
static PyObject *__pyx_n_s_unicodedata_2;
static PyObject *__pyx_n_s_warn;
static PyObject *__pyx_n_s_warnings;
static PyObject *__pyx_n_s_warnings_2;
static PyObject *__pyx_n_s_x;
static PyObject *__pyx_n_s_xrange;
static PyObject *__pyx_pf_9pyclipper_log_action(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_description); /* proto */
static PyObject *__pyx_pf_9pyclipper_10PyPolyNode___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pyclipper_2Orientation(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_poly); /* proto */
static PyObject *__pyx_pf_9pyclipper_4Area(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_poly); /* proto */
static PyObject *__pyx_pf_9pyclipper_6PointInPolygon(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_point, PyObject *__pyx_v_poly); /* proto */
static PyObject *__pyx_pf_9pyclipper_8SimplifyPolygon(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_poly, enum ClipperLib::PolyFillType __pyx_v_fill_type); /* proto */
static PyObject *__pyx_pf_9pyclipper_10SimplifyPolygons(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_polys, enum ClipperLib::PolyFillType __pyx_v_fill_type); /* proto */
static PyObject *__pyx_pf_9pyclipper_12CleanPolygon(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_poly, double __pyx_v_distance); /* proto */
static PyObject *__pyx_pf_9pyclipper_14CleanPolygons(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_polys, double __pyx_v_distance); /* proto */
static PyObject *__pyx_pf_9pyclipper_16MinkowskiSum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_pattern, PyObject *__pyx_v_path, int __pyx_v_path_is_closed); /* proto */
static PyObject *__pyx_pf_9pyclipper_18MinkowskiSum2(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_pattern, PyObject *__pyx_v_paths, int __pyx_v_path_is_closed); /* proto */
static PyObject *__pyx_pf_9pyclipper_20MinkowskiDiff(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_poly1, PyObject *__pyx_v_poly2); /* proto */
static PyObject *__pyx_pf_9pyclipper_22PolyTreeToPaths(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_poly_node); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_pn); /* proto */
static PyObject *__pyx_pf_9pyclipper_24ClosedPathsFromPolyTree(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_poly_node); /* proto */
static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_pn); /* proto */
static PyObject *__pyx_pf_9pyclipper_26OpenPathsFromPolyTree(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_poly_node); /* proto */
static PyObject *__pyx_pf_9pyclipper_28ReversePath(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path); /* proto */
static PyObject *__pyx_pf_9pyclipper_30ReversePaths(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_paths); /* proto */
static PyObject *__pyx_pf_9pyclipper_16scale_to_clipper_scale_value(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_9pyclipper_32scale_to_clipper(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path_or_paths, PyObject *__pyx_v_scale); /* proto */
static PyObject *__pyx_pf_9pyclipper_18scale_from_clipper_scale_value(PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_9pyclipper_34scale_from_clipper(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path_or_paths, PyObject *__pyx_v_scale); /* proto */
static int __pyx_pf_9pyclipper_9Pyclipper___cinit__(struct __pyx_obj_9pyclipper_Pyclipper *__pyx_v_self); /* proto */
static void __pyx_pf_9pyclipper_9Pyclipper_2__dealloc__(struct __pyx_obj_9pyclipper_Pyclipper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pyclipper_9Pyclipper_4AddPath(struct __pyx_obj_9pyclipper_Pyclipper *__pyx_v_self, PyObject *__pyx_v_path, enum ClipperLib::PolyType __pyx_v_poly_type, PyObject *__pyx_v_closed); /* proto */
static PyObject *__pyx_pf_9pyclipper_9Pyclipper_6AddPaths(struct __pyx_obj_9pyclipper_Pyclipper *__pyx_v_self, PyObject *__pyx_v_paths, enum ClipperLib::PolyType __pyx_v_poly_type, PyObject *__pyx_v_closed); /* proto */
static PyObject *__pyx_pf_9pyclipper_9Pyclipper_8Clear(struct __pyx_obj_9pyclipper_Pyclipper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pyclipper_9Pyclipper_10GetBounds(struct __pyx_obj_9pyclipper_Pyclipper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pyclipper_9Pyclipper_12Execute(struct __pyx_obj_9pyclipper_Pyclipper *__pyx_v_self, enum ClipperLib::ClipType __pyx_v_clip_type, enum ClipperLib::PolyFillType __pyx_v_subj_fill_type, enum ClipperLib::PolyFillType __pyx_v_clip_fill_type); /* proto */
static PyObject *__pyx_pf_9pyclipper_9Pyclipper_14Execute2(struct __pyx_obj_9pyclipper_Pyclipper *__pyx_v_self, enum ClipperLib::ClipType __pyx_v_clip_type, enum ClipperLib::PolyFillType __pyx_v_subj_fill_type, enum ClipperLib::PolyFillType __pyx_v_clip_fill_type); /* proto */
static PyObject *__pyx_pf_9pyclipper_9Pyclipper_15ReverseSolution___get__(struct __pyx_obj_9pyclipper_Pyclipper *__pyx_v_self); /* proto */
static int __pyx_pf_9pyclipper_9Pyclipper_15ReverseSolution_2__set__(struct __pyx_obj_9pyclipper_Pyclipper *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_9pyclipper_9Pyclipper_17PreserveCollinear___get__(struct __pyx_obj_9pyclipper_Pyclipper *__pyx_v_self); /* proto */
static int __pyx_pf_9pyclipper_9Pyclipper_17PreserveCollinear_2__set__(struct __pyx_obj_9pyclipper_Pyclipper *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_9pyclipper_9Pyclipper_14StrictlySimple___get__(struct __pyx_obj_9pyclipper_Pyclipper *__pyx_v_self); /* proto */
static int __pyx_pf_9pyclipper_9Pyclipper_14StrictlySimple_2__set__(struct __pyx_obj_9pyclipper_Pyclipper *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_9pyclipper_15PyclipperOffset___cinit__(struct __pyx_obj_9pyclipper_PyclipperOffset *__pyx_v_self, double __pyx_v_miter_limit, double __pyx_v_arc_tolerance); /* proto */
static void __pyx_pf_9pyclipper_15PyclipperOffset_2__dealloc__(struct __pyx_obj_9pyclipper_PyclipperOffset *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pyclipper_15PyclipperOffset_4AddPath(struct __pyx_obj_9pyclipper_PyclipperOffset *__pyx_v_self, PyObject *__pyx_v_path, enum ClipperLib::JoinType __pyx_v_join_type, enum ClipperLib::EndType __pyx_v_end_type); /* proto */
static PyObject *__pyx_pf_9pyclipper_15PyclipperOffset_6AddPaths(struct __pyx_obj_9pyclipper_PyclipperOffset *__pyx_v_self, PyObject *__pyx_v_paths, enum ClipperLib::JoinType __pyx_v_join_type, enum ClipperLib::EndType __pyx_v_end_type); /* proto */
static PyObject *__pyx_pf_9pyclipper_15PyclipperOffset_8Execute(struct __pyx_obj_9pyclipper_PyclipperOffset *__pyx_v_self, double __pyx_v_delta); /* proto */
static PyObject *__pyx_pf_9pyclipper_15PyclipperOffset_10Execute2(struct __pyx_obj_9pyclipper_PyclipperOffset *__pyx_v_self, double __pyx_v_delta); /* proto */
static PyObject *__pyx_pf_9pyclipper_15PyclipperOffset_12Clear(struct __pyx_obj_9pyclipper_PyclipperOffset *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pyclipper_15PyclipperOffset_10MiterLimit___get__(struct __pyx_obj_9pyclipper_PyclipperOffset *__pyx_v_self); /* proto */
static int __pyx_pf_9pyclipper_15PyclipperOffset_10MiterLimit_2__set__(struct __pyx_obj_9pyclipper_PyclipperOffset *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_9pyclipper_15PyclipperOffset_12ArcTolerance___get__(struct __pyx_obj_9pyclipper_PyclipperOffset *__pyx_v_self); /* proto */
static int __pyx_pf_9pyclipper_15PyclipperOffset_12ArcTolerance_2__set__(struct __pyx_obj_9pyclipper_PyclipperOffset *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_9pyclipper_36_check_scaling_factor(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_tp_new_9pyclipper_Pyclipper(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pyclipper_PyclipperOffset(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pyclipper___pyx_scope_struct__scale_to_clipper(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pyclipper___pyx_scope_struct_1_scale_from_clipper(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2147483648;
static enum ClipperLib::PolyFillType __pyx_k_;
static enum ClipperLib::PolyFillType __pyx_k__2;
static enum ClipperLib::PolyFillType __pyx_k__11;
static enum ClipperLib::PolyFillType __pyx_k__12;
static enum ClipperLib::PolyFillType __pyx_k__14;
static enum ClipperLib::PolyFillType __pyx_k__15;
static PyObject *__pyx_tuple__3;
static PyObject *__pyx_tuple__5;
static PyObject *__pyx_tuple__7;
static PyObject *__pyx_tuple__8;
static PyObject *__pyx_tuple__9;
static PyObject *__pyx_tuple__10;
static PyObject *__pyx_tuple__13;
static PyObject *__pyx_tuple__16;
static PyObject *__pyx_tuple__17;
static PyObject *__pyx_tuple__18;
static PyObject *__pyx_tuple__19;
static PyObject *__pyx_tuple__21;
static PyObject *__pyx_tuple__22;
static PyObject *__pyx_tuple__24;
static PyObject *__pyx_tuple__26;
static PyObject *__pyx_tuple__28;
static PyObject *__pyx_tuple__30;
static PyObject *__pyx_tuple__32;
static PyObject *__pyx_tuple__34;
static PyObject *__pyx_tuple__36;
static PyObject *__pyx_tuple__38;
static PyObject *__pyx_tuple__40;
static PyObject *__pyx_tuple__42;
static PyObject *__pyx_tuple__44;
static PyObject *__pyx_tuple__46;
static PyObject *__pyx_tuple__48;
static PyObject *__pyx_tuple__50;
static PyObject *__pyx_tuple__52;
static PyObject *__pyx_tuple__54;
static PyObject *__pyx_tuple__56;
static PyObject *__pyx_codeobj__4;
static PyObject *__pyx_codeobj__6;
static PyObject *__pyx_codeobj__20;
static PyObject *__pyx_codeobj__23;
static PyObject *__pyx_codeobj__25;
static PyObject *__pyx_codeobj__27;
static PyObject *__pyx_codeobj__29;
static PyObject *__pyx_codeobj__31;
static PyObject *__pyx_codeobj__33;
static PyObject *__pyx_codeobj__35;
static PyObject *__pyx_codeobj__37;
static PyObject *__pyx_codeobj__39;
static PyObject *__pyx_codeobj__41;
static PyObject *__pyx_codeobj__43;
static PyObject *__pyx_codeobj__45;
static PyObject *__pyx_codeobj__47;
static PyObject *__pyx_codeobj__49;
static PyObject *__pyx_codeobj__51;
static PyObject *__pyx_codeobj__53;
static PyObject *__pyx_codeobj__55;
static PyObject *__pyx_codeobj__57;
static PyObject *__pyx_codeobj__58;

/* "pyclipper.pyx":17
 * 
 * 
 * def log_action(description):             # <<<<<<<<<<<<<<
 *     if not SILENT:
 *         print description
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pyclipper_1log_action(PyObject *__pyx_self, PyObject *__pyx_v_description); /*proto*/
static PyMethodDef __pyx_mdef_9pyclipper_1log_action = {"log_action", (PyCFunction)__pyx_pw_9pyclipper_1log_action, METH_O, 0};
static PyObject *__pyx_pw_9pyclipper_1log_action(PyObject *__pyx_self, PyObject *__pyx_v_description) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("log_action (wrapper)", 0);
  __pyx_r = __pyx_pf_9pyclipper_log_action(__pyx_self, ((PyObject *)__pyx_v_description));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pyclipper_log_action(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_description) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("log_action", 0);

  /* "pyclipper.pyx":18
 * 
 * def log_action(description):
 *     if not SILENT:             # <<<<<<<<<<<<<<
 *         print description
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SILENT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = ((!__pyx_t_2) != 0);
  if (__pyx_t_3) {

    /* "pyclipper.pyx":19
 * def log_action(description):
 *     if not SILENT:
 *         print description             # <<<<<<<<<<<<<<
 * 
 * log_action("Python binding clipper library")
 */
    if (__Pyx_PrintOne(0, __pyx_v_description) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pyclipper.pyx":18
 * 
 * def log_action(description):
 *     if not SILENT:             # <<<<<<<<<<<<<<
 *         print description
 * 
 */
  }

  /* "pyclipper.pyx":17
 * 
 * 
 * def log_action(description):             # <<<<<<<<<<<<<<
 *     if not SILENT:
 *         print description
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyclipper.log_action", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":248
 *     Represents ClipperLibs' PolyTree and PolyNode data structures.
 *     """
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self.Contour = []
 *         self.Childs = []
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pyclipper_10PyPolyNode_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_9pyclipper_10PyPolyNode_1__init__ = {"__init__", (PyCFunction)__pyx_pw_9pyclipper_10PyPolyNode_1__init__, METH_O, 0};
static PyObject *__pyx_pw_9pyclipper_10PyPolyNode_1__init__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pyclipper_10PyPolyNode___init__(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pyclipper_10PyPolyNode___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pyclipper.pyx":249
 *     """
 *     def __init__(self):
 *         self.Contour = []             # <<<<<<<<<<<<<<
 *         self.Childs = []
 *         self.Parent = None
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Contour, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyclipper.pyx":250
 *     def __init__(self):
 *         self.Contour = []
 *         self.Childs = []             # <<<<<<<<<<<<<<
 *         self.Parent = None
 *         self.IsHole = False
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Childs, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyclipper.pyx":251
 *         self.Contour = []
 *         self.Childs = []
 *         self.Parent = None             # <<<<<<<<<<<<<<
 *         self.IsHole = False
 *         self.IsOpen = False
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Parent, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyclipper.pyx":252
 *         self.Childs = []
 *         self.Parent = None
 *         self.IsHole = False             # <<<<<<<<<<<<<<
 *         self.IsOpen = False
 *         self.depth = 0
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_IsHole, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyclipper.pyx":253
 *         self.Parent = None
 *         self.IsHole = False
 *         self.IsOpen = False             # <<<<<<<<<<<<<<
 *         self.depth = 0
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_IsOpen, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyclipper.pyx":254
 *         self.IsHole = False
 *         self.IsOpen = False
 *         self.depth = 0             # <<<<<<<<<<<<<<
 * 
 * #=============================  Other objects ==============
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_depth, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyclipper.pyx":248
 *     Represents ClipperLibs' PolyTree and PolyNode data structures.
 *     """
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self.Contour = []
 *         self.Childs = []
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyclipper.PyPolyNode.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":264
 * 
 * #============================= Namespace functions =========
 * def Orientation(poly):             # <<<<<<<<<<<<<<
 *     """ Get orientation of the supplied polygon.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/Orientation.htm
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pyclipper_3Orientation(PyObject *__pyx_self, PyObject *__pyx_v_poly); /*proto*/
static char __pyx_doc_9pyclipper_2Orientation[] = " Get orientation of the supplied polygon.\n    More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/Orientation.htm\n\n    Keyword arguments:\n    poly -- closed polygon\n\n    Returns:\n    True  -- counter-clockwise orientation\n    False -- clockwise orientation\n    ";
static PyMethodDef __pyx_mdef_9pyclipper_3Orientation = {"Orientation", (PyCFunction)__pyx_pw_9pyclipper_3Orientation, METH_O, __pyx_doc_9pyclipper_2Orientation};
static PyObject *__pyx_pw_9pyclipper_3Orientation(PyObject *__pyx_self, PyObject *__pyx_v_poly) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Orientation (wrapper)", 0);
  __pyx_r = __pyx_pf_9pyclipper_2Orientation(__pyx_self, ((PyObject *)__pyx_v_poly));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pyclipper_2Orientation(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_poly) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Orientation", 0);

  /* "pyclipper.pyx":275
 *     False -- clockwise orientation
 *     """
 *     return <bint>c_Orientation(_to_clipper_path(poly))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong((Orientation(__pyx_f_9pyclipper__to_clipper_path(__pyx_v_poly)) != 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyclipper.pyx":264
 * 
 * #============================= Namespace functions =========
 * def Orientation(poly):             # <<<<<<<<<<<<<<
 *     """ Get orientation of the supplied polygon.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/Orientation.htm
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyclipper.Orientation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":278
 * 
 * 
 * def Area(poly):             # <<<<<<<<<<<<<<
 *     """ Get area of the supplied polygon.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/Area.htm
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pyclipper_5Area(PyObject *__pyx_self, PyObject *__pyx_v_poly); /*proto*/
static char __pyx_doc_9pyclipper_4Area[] = " Get area of the supplied polygon.\n    More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/Area.htm\n\n    Keyword arguments:\n    poly -- closed polygon\n\n    Returns:\n    Positive number if orientation is True\n    Negative number if orientation is False\n    ";
static PyMethodDef __pyx_mdef_9pyclipper_5Area = {"Area", (PyCFunction)__pyx_pw_9pyclipper_5Area, METH_O, __pyx_doc_9pyclipper_4Area};
static PyObject *__pyx_pw_9pyclipper_5Area(PyObject *__pyx_self, PyObject *__pyx_v_poly) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Area (wrapper)", 0);
  __pyx_r = __pyx_pf_9pyclipper_4Area(__pyx_self, ((PyObject *)__pyx_v_poly));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pyclipper_4Area(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_poly) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Area", 0);

  /* "pyclipper.pyx":290
 *     """
 * 
 *     return <double>c_Area(_to_clipper_path(poly))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(((double)Area(__pyx_f_9pyclipper__to_clipper_path(__pyx_v_poly)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyclipper.pyx":278
 * 
 * 
 * def Area(poly):             # <<<<<<<<<<<<<<
 *     """ Get area of the supplied polygon.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/Area.htm
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyclipper.Area", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":293
 * 
 * 
 * def PointInPolygon(point, poly):             # <<<<<<<<<<<<<<
 *     """ Determine where does the point lie regarding the provided polygon.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/PointInPolygon.htm
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pyclipper_7PointInPolygon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pyclipper_6PointInPolygon[] = " Determine where does the point lie regarding the provided polygon.\n    More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/PointInPolygon.htm\n\n    Keyword arguments:\n    point -- point in question\n    poly  -- closed polygon\n\n    Returns:\n    0  -- point is not in polygon\n    -1 -- point is on polygon\n    1  -- point is in polygon\n    ";
static PyMethodDef __pyx_mdef_9pyclipper_7PointInPolygon = {"PointInPolygon", (PyCFunction)__pyx_pw_9pyclipper_7PointInPolygon, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pyclipper_6PointInPolygon};
static PyObject *__pyx_pw_9pyclipper_7PointInPolygon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_point = 0;
  PyObject *__pyx_v_poly = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("PointInPolygon (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_point,&__pyx_n_s_poly,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_point)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_poly)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("PointInPolygon", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "PointInPolygon") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_point = values[0];
    __pyx_v_poly = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("PointInPolygon", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyclipper.PointInPolygon", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pyclipper_6PointInPolygon(__pyx_self, __pyx_v_point, __pyx_v_poly);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pyclipper_6PointInPolygon(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_point, PyObject *__pyx_v_poly) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PointInPolygon", 0);

  /* "pyclipper.pyx":307
 *     """
 * 
 *     return <int>c_PointInPolygon(_to_clipper_point(point),             # <<<<<<<<<<<<<<
 *                                _to_clipper_path(poly))
 * 
 */
  __Pyx_XDECREF(__pyx_r);

  /* "pyclipper.pyx":308
 * 
 *     return <int>c_PointInPolygon(_to_clipper_point(point),
 *                                _to_clipper_path(poly))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(((int)PointInPolygon(__pyx_f_9pyclipper__to_clipper_point(__pyx_v_point), __pyx_f_9pyclipper__to_clipper_path(__pyx_v_poly)))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyclipper.pyx":293
 * 
 * 
 * def PointInPolygon(point, poly):             # <<<<<<<<<<<<<<
 *     """ Determine where does the point lie regarding the provided polygon.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/PointInPolygon.htm
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyclipper.PointInPolygon", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":311
 * 
 * 
 * def SimplifyPolygon(poly, PolyFillType fill_type=pftEvenOdd):             # <<<<<<<<<<<<<<
 *     """ Removes self-intersections from the supplied polygon.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/SimplifyPolygon.htm
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pyclipper_9SimplifyPolygon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pyclipper_8SimplifyPolygon[] = " Removes self-intersections from the supplied polygon.\n    More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/SimplifyPolygon.htm\n\n    Keyword arguments:\n    poly      -- polygon to be simplified\n    fill_type -- PolyFillType used with the boolean union operation\n\n    Returns:\n    list of simplified polygons (containing one or more polygons)\n    ";
static PyMethodDef __pyx_mdef_9pyclipper_9SimplifyPolygon = {"SimplifyPolygon", (PyCFunction)__pyx_pw_9pyclipper_9SimplifyPolygon, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pyclipper_8SimplifyPolygon};
static PyObject *__pyx_pw_9pyclipper_9SimplifyPolygon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_poly = 0;
  enum ClipperLib::PolyFillType __pyx_v_fill_type;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("SimplifyPolygon (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_poly,&__pyx_n_s_fill_type,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_poly)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_type);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "SimplifyPolygon") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_poly = values[0];
    if (values[1]) {
      __pyx_v_fill_type = ((enum ClipperLib::PolyFillType)__Pyx_PyInt_As_enum__ClipperLib_3a__3a_PolyFillType(values[1])); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_fill_type = __pyx_k_;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("SimplifyPolygon", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyclipper.SimplifyPolygon", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pyclipper_8SimplifyPolygon(__pyx_self, __pyx_v_poly, __pyx_v_fill_type);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pyclipper_8SimplifyPolygon(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_poly, enum ClipperLib::PolyFillType __pyx_v_fill_type) {
  ClipperLib::Paths __pyx_v_out_polys;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("SimplifyPolygon", 0);

  /* "pyclipper.pyx":323
 *     """
 *     cdef Paths out_polys
 *     c_SimplifyPolygon(_to_clipper_path(poly), out_polys, fill_type)             # <<<<<<<<<<<<<<
 *     return _from_clipper_paths(out_polys)
 * 
 */
  SimplifyPolygon(__pyx_f_9pyclipper__to_clipper_path(__pyx_v_poly), __pyx_v_out_polys, __pyx_v_fill_type);

  /* "pyclipper.pyx":324
 *     cdef Paths out_polys
 *     c_SimplifyPolygon(_to_clipper_path(poly), out_polys, fill_type)
 *     return _from_clipper_paths(out_polys)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pyclipper__from_clipper_paths(__pyx_v_out_polys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyclipper.pyx":311
 * 
 * 
 * def SimplifyPolygon(poly, PolyFillType fill_type=pftEvenOdd):             # <<<<<<<<<<<<<<
 *     """ Removes self-intersections from the supplied polygon.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/SimplifyPolygon.htm
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyclipper.SimplifyPolygon", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":327
 * 
 * 
 * def SimplifyPolygons(polys, PolyFillType fill_type=pftEvenOdd):             # <<<<<<<<<<<<<<
 *     """ Removes self-intersections from the supplied polygons.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/SimplifyPolygons.htm
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pyclipper_11SimplifyPolygons(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pyclipper_10SimplifyPolygons[] = " Removes self-intersections from the supplied polygons.\n    More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/SimplifyPolygons.htm\n\n    Keyword arguments:\n    polys     -- polygons to be simplified\n    fill_type -- PolyFillType used with the boolean union operation\n\n    Returns:\n    list of simplified polygons\n    ";
static PyMethodDef __pyx_mdef_9pyclipper_11SimplifyPolygons = {"SimplifyPolygons", (PyCFunction)__pyx_pw_9pyclipper_11SimplifyPolygons, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pyclipper_10SimplifyPolygons};
static PyObject *__pyx_pw_9pyclipper_11SimplifyPolygons(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_polys = 0;
  enum ClipperLib::PolyFillType __pyx_v_fill_type;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("SimplifyPolygons (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_polys,&__pyx_n_s_fill_type,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_polys)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fill_type);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "SimplifyPolygons") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_polys = values[0];
    if (values[1]) {
      __pyx_v_fill_type = ((enum ClipperLib::PolyFillType)__Pyx_PyInt_As_enum__ClipperLib_3a__3a_PolyFillType(values[1])); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_fill_type = __pyx_k__2;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("SimplifyPolygons", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyclipper.SimplifyPolygons", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pyclipper_10SimplifyPolygons(__pyx_self, __pyx_v_polys, __pyx_v_fill_type);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pyclipper_10SimplifyPolygons(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_polys, enum ClipperLib::PolyFillType __pyx_v_fill_type) {
  ClipperLib::Paths __pyx_v_out_polys;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("SimplifyPolygons", 0);

  /* "pyclipper.pyx":339
 *     """
 *     cdef Paths out_polys
 *     c_SimplifyPolygons(_to_clipper_paths(polys), out_polys, fill_type)             # <<<<<<<<<<<<<<
 *     return _from_clipper_paths(out_polys)
 * 
 */
  SimplifyPolygons(__pyx_f_9pyclipper__to_clipper_paths(__pyx_v_polys), __pyx_v_out_polys, __pyx_v_fill_type);

  /* "pyclipper.pyx":340
 *     cdef Paths out_polys
 *     c_SimplifyPolygons(_to_clipper_paths(polys), out_polys, fill_type)
 *     return _from_clipper_paths(out_polys)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pyclipper__from_clipper_paths(__pyx_v_out_polys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyclipper.pyx":327
 * 
 * 
 * def SimplifyPolygons(polys, PolyFillType fill_type=pftEvenOdd):             # <<<<<<<<<<<<<<
 *     """ Removes self-intersections from the supplied polygons.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/SimplifyPolygons.htm
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyclipper.SimplifyPolygons", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":343
 * 
 * 
 * def CleanPolygon(poly, double distance=1.415):             # <<<<<<<<<<<<<<
 *     """ Removes unnecessary vertices from the provided polygon.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/CleanPolygon.htm
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pyclipper_13CleanPolygon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pyclipper_12CleanPolygon[] = " Removes unnecessary vertices from the provided polygon.\n    More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/CleanPolygon.htm\n\n    Keyword arguments:\n    poly     -- polygon to be cleaned\n    distance -- distance on which vertices are removed, see 'More info' (default: approx. sqrt of 2)\n\n    Returns:\n    cleaned polygon\n    ";
static PyMethodDef __pyx_mdef_9pyclipper_13CleanPolygon = {"CleanPolygon", (PyCFunction)__pyx_pw_9pyclipper_13CleanPolygon, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pyclipper_12CleanPolygon};
static PyObject *__pyx_pw_9pyclipper_13CleanPolygon(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_poly = 0;
  double __pyx_v_distance;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("CleanPolygon (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_poly,&__pyx_n_s_distance,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_poly)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_distance);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CleanPolygon") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_poly = values[0];
    if (values[1]) {
      __pyx_v_distance = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_distance == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_distance = ((double)1.415);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("CleanPolygon", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyclipper.CleanPolygon", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pyclipper_12CleanPolygon(__pyx_self, __pyx_v_poly, __pyx_v_distance);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pyclipper_12CleanPolygon(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_poly, double __pyx_v_distance) {
  ClipperLib::Path __pyx_v_out_poly;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("CleanPolygon", 0);

  /* "pyclipper.pyx":355
 *     """
 *     cdef Path out_poly
 *     c_CleanPolygon(_to_clipper_path(poly), out_poly, distance)             # <<<<<<<<<<<<<<
 *     return _from_clipper_path(out_poly)
 * 
 */
  CleanPolygon(__pyx_f_9pyclipper__to_clipper_path(__pyx_v_poly), __pyx_v_out_poly, __pyx_v_distance);

  /* "pyclipper.pyx":356
 *     cdef Path out_poly
 *     c_CleanPolygon(_to_clipper_path(poly), out_poly, distance)
 *     return _from_clipper_path(out_poly)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pyclipper__from_clipper_path(__pyx_v_out_poly); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyclipper.pyx":343
 * 
 * 
 * def CleanPolygon(poly, double distance=1.415):             # <<<<<<<<<<<<<<
 *     """ Removes unnecessary vertices from the provided polygon.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/CleanPolygon.htm
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyclipper.CleanPolygon", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":359
 * 
 * 
 * def CleanPolygons(polys, double distance=1.415):             # <<<<<<<<<<<<<<
 *     """ Removes unnecessary vertices from the provided polygons.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/CleanPolygons.htm
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pyclipper_15CleanPolygons(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pyclipper_14CleanPolygons[] = " Removes unnecessary vertices from the provided polygons.\n    More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/CleanPolygons.htm\n\n    Keyword arguments:\n    polys    -- polygons to be cleaned\n    distance -- distance on which vertices are removed, see 'More info' (default: approx. sqrt of 2)\n\n    Returns:\n    list of cleaned polygons\n    ";
static PyMethodDef __pyx_mdef_9pyclipper_15CleanPolygons = {"CleanPolygons", (PyCFunction)__pyx_pw_9pyclipper_15CleanPolygons, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pyclipper_14CleanPolygons};
static PyObject *__pyx_pw_9pyclipper_15CleanPolygons(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_polys = 0;
  double __pyx_v_distance;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("CleanPolygons (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_polys,&__pyx_n_s_distance,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_polys)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_distance);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "CleanPolygons") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_polys = values[0];
    if (values[1]) {
      __pyx_v_distance = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_distance == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_distance = ((double)1.415);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("CleanPolygons", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyclipper.CleanPolygons", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pyclipper_14CleanPolygons(__pyx_self, __pyx_v_polys, __pyx_v_distance);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pyclipper_14CleanPolygons(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_polys, double __pyx_v_distance) {
  ClipperLib::Paths __pyx_v_out_polys;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("CleanPolygons", 0);

  /* "pyclipper.pyx":370
 *     list of cleaned polygons
 *     """
 *     cdef Paths out_polys = _to_clipper_paths(polys)             # <<<<<<<<<<<<<<
 *     c_CleanPolygons(out_polys, distance)
 *     return _from_clipper_paths(out_polys)
 */
  __pyx_v_out_polys = __pyx_f_9pyclipper__to_clipper_paths(__pyx_v_polys);

  /* "pyclipper.pyx":371
 *     """
 *     cdef Paths out_polys = _to_clipper_paths(polys)
 *     c_CleanPolygons(out_polys, distance)             # <<<<<<<<<<<<<<
 *     return _from_clipper_paths(out_polys)
 * 
 */
  CleanPolygons(__pyx_v_out_polys, __pyx_v_distance);

  /* "pyclipper.pyx":372
 *     cdef Paths out_polys = _to_clipper_paths(polys)
 *     c_CleanPolygons(out_polys, distance)
 *     return _from_clipper_paths(out_polys)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pyclipper__from_clipper_paths(__pyx_v_out_polys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyclipper.pyx":359
 * 
 * 
 * def CleanPolygons(polys, double distance=1.415):             # <<<<<<<<<<<<<<
 *     """ Removes unnecessary vertices from the provided polygons.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/CleanPolygons.htm
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyclipper.CleanPolygons", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":375
 * 
 * 
 * def MinkowskiSum(pattern, path, bint path_is_closed):             # <<<<<<<<<<<<<<
 *     """ Performs Minkowski Addition of the pattern and path.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/MinkowskiSum.htm
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pyclipper_17MinkowskiSum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pyclipper_16MinkowskiSum[] = " Performs Minkowski Addition of the pattern and path.\n    More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/MinkowskiSum.htm\n\n    Keyword arguments:\n    pattern        -- polygon whose points are added to the path\n    path           -- open or closed path\n    path_is_closed -- set to True if passed path is closed, False if open\n\n    Returns:\n    list of polygons (containing one or more polygons)\n    ";
static PyMethodDef __pyx_mdef_9pyclipper_17MinkowskiSum = {"MinkowskiSum", (PyCFunction)__pyx_pw_9pyclipper_17MinkowskiSum, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pyclipper_16MinkowskiSum};
static PyObject *__pyx_pw_9pyclipper_17MinkowskiSum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pattern = 0;
  PyObject *__pyx_v_path = 0;
  int __pyx_v_path_is_closed;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("MinkowskiSum (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pattern,&__pyx_n_s_path,&__pyx_n_s_path_is_closed,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pattern)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("MinkowskiSum", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_path_is_closed)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("MinkowskiSum", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MinkowskiSum") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_pattern = values[0];
    __pyx_v_path = values[1];
    __pyx_v_path_is_closed = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_path_is_closed == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("MinkowskiSum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyclipper.MinkowskiSum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pyclipper_16MinkowskiSum(__pyx_self, __pyx_v_pattern, __pyx_v_path, __pyx_v_path_is_closed);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pyclipper_16MinkowskiSum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_pattern, PyObject *__pyx_v_path, int __pyx_v_path_is_closed) {
  ClipperLib::Paths __pyx_v_solution;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("MinkowskiSum", 0);

  /* "pyclipper.pyx":388
 *     """
 *     cdef Paths solution
 *     c_MinkowskiSum(_to_clipper_path(pattern),             # <<<<<<<<<<<<<<
 *                  _to_clipper_path(path),
 *                  solution,
 */
  MinkowskiSum(__pyx_f_9pyclipper__to_clipper_path(__pyx_v_pattern), __pyx_f_9pyclipper__to_clipper_path(__pyx_v_path), __pyx_v_solution, __pyx_v_path_is_closed);

  /* "pyclipper.pyx":393
 *                  path_is_closed
 *     )
 *     return _from_clipper_paths(solution)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pyclipper__from_clipper_paths(__pyx_v_solution); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyclipper.pyx":375
 * 
 * 
 * def MinkowskiSum(pattern, path, bint path_is_closed):             # <<<<<<<<<<<<<<
 *     """ Performs Minkowski Addition of the pattern and path.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/MinkowskiSum.htm
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyclipper.MinkowskiSum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":396
 * 
 * 
 * def MinkowskiSum2(pattern, paths, bint path_is_closed):             # <<<<<<<<<<<<<<
 *     """ Performs Minkowski Addition of the pattern and paths.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/MinkowskiSum.htm
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pyclipper_19MinkowskiSum2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pyclipper_18MinkowskiSum2[] = " Performs Minkowski Addition of the pattern and paths.\n    More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/MinkowskiSum.htm\n\n    Keyword arguments:\n    pattern        -- polygon whose points are added to the paths\n    paths          -- open or closed paths\n    path_is_closed -- set to True if passed paths are closed, False if open\n\n    Returns:\n    list of polygons\n    ";
static PyMethodDef __pyx_mdef_9pyclipper_19MinkowskiSum2 = {"MinkowskiSum2", (PyCFunction)__pyx_pw_9pyclipper_19MinkowskiSum2, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pyclipper_18MinkowskiSum2};
static PyObject *__pyx_pw_9pyclipper_19MinkowskiSum2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pattern = 0;
  PyObject *__pyx_v_paths = 0;
  int __pyx_v_path_is_closed;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("MinkowskiSum2 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pattern,&__pyx_n_s_paths,&__pyx_n_s_path_is_closed,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pattern)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_paths)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("MinkowskiSum2", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_path_is_closed)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("MinkowskiSum2", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MinkowskiSum2") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_pattern = values[0];
    __pyx_v_paths = values[1];
    __pyx_v_path_is_closed = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_path_is_closed == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("MinkowskiSum2", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyclipper.MinkowskiSum2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pyclipper_18MinkowskiSum2(__pyx_self, __pyx_v_pattern, __pyx_v_paths, __pyx_v_path_is_closed);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pyclipper_18MinkowskiSum2(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_pattern, PyObject *__pyx_v_paths, int __pyx_v_path_is_closed) {
  ClipperLib::Paths __pyx_v_solution;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("MinkowskiSum2", 0);

  /* "pyclipper.pyx":409
 *     """
 *     cdef Paths solution
 *     c_MinkowskiSum(             # <<<<<<<<<<<<<<
 *         _to_clipper_path(pattern),
 *         _to_clipper_paths(paths),
 */
  MinkowskiSum(__pyx_f_9pyclipper__to_clipper_path(__pyx_v_pattern), __pyx_f_9pyclipper__to_clipper_paths(__pyx_v_paths), __pyx_v_solution, __pyx_v_path_is_closed);

  /* "pyclipper.pyx":415
 *         path_is_closed
 *     )
 *     return _from_clipper_paths(solution)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pyclipper__from_clipper_paths(__pyx_v_solution); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyclipper.pyx":396
 * 
 * 
 * def MinkowskiSum2(pattern, paths, bint path_is_closed):             # <<<<<<<<<<<<<<
 *     """ Performs Minkowski Addition of the pattern and paths.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/MinkowskiSum.htm
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyclipper.MinkowskiSum2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":418
 * 
 * 
 * def MinkowskiDiff(poly1, poly2):             # <<<<<<<<<<<<<<
 *     """ Performs Minkowski Difference.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/MinkowskiDiff.htm
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pyclipper_21MinkowskiDiff(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pyclipper_20MinkowskiDiff[] = " Performs Minkowski Difference.\n    More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/MinkowskiDiff.htm\n\n    Keyword arguments:\n    poly1 -- polygon\n    poly2 -- polygon\n\n    Returns:\n    list of polygons\n    ";
static PyMethodDef __pyx_mdef_9pyclipper_21MinkowskiDiff = {"MinkowskiDiff", (PyCFunction)__pyx_pw_9pyclipper_21MinkowskiDiff, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pyclipper_20MinkowskiDiff};
static PyObject *__pyx_pw_9pyclipper_21MinkowskiDiff(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_poly1 = 0;
  PyObject *__pyx_v_poly2 = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("MinkowskiDiff (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_poly1,&__pyx_n_s_poly2,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_poly1)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_poly2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("MinkowskiDiff", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "MinkowskiDiff") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_poly1 = values[0];
    __pyx_v_poly2 = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("MinkowskiDiff", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyclipper.MinkowskiDiff", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pyclipper_20MinkowskiDiff(__pyx_self, __pyx_v_poly1, __pyx_v_poly2);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pyclipper_20MinkowskiDiff(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_poly1, PyObject *__pyx_v_poly2) {
  ClipperLib::Paths __pyx_v_solution;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("MinkowskiDiff", 0);

  /* "pyclipper.pyx":430
 *     """
 *     cdef Paths solution
 *     c_MinkowskiDiff(_to_clipper_path(poly1), _to_clipper_path(poly2), solution)             # <<<<<<<<<<<<<<
 *     return _from_clipper_paths(solution)
 * 
 */
  MinkowskiDiff(__pyx_f_9pyclipper__to_clipper_path(__pyx_v_poly1), __pyx_f_9pyclipper__to_clipper_path(__pyx_v_poly2), __pyx_v_solution);

  /* "pyclipper.pyx":431
 *     cdef Paths solution
 *     c_MinkowskiDiff(_to_clipper_path(poly1), _to_clipper_path(poly2), solution)
 *     return _from_clipper_paths(solution)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pyclipper__from_clipper_paths(__pyx_v_solution); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyclipper.pyx":418
 * 
 * 
 * def MinkowskiDiff(poly1, poly2):             # <<<<<<<<<<<<<<
 *     """ Performs Minkowski Difference.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/MinkowskiDiff.htm
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyclipper.MinkowskiDiff", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":434
 * 
 * 
 * def PolyTreeToPaths(poly_node):             # <<<<<<<<<<<<<<
 *     """ Converts a PyPolyNode to a list of paths.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/PolyTreeToPaths.htm
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pyclipper_23PolyTreeToPaths(PyObject *__pyx_self, PyObject *__pyx_v_poly_node); /*proto*/
static char __pyx_doc_9pyclipper_22PolyTreeToPaths[] = " Converts a PyPolyNode to a list of paths.\n    More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/PolyTreeToPaths.htm\n\n    Keyword arguments:\n    py_poly_node -- PyPolyNode to be filtered\n\n    Returns:\n    list of paths\n    ";
static PyMethodDef __pyx_mdef_9pyclipper_23PolyTreeToPaths = {"PolyTreeToPaths", (PyCFunction)__pyx_pw_9pyclipper_23PolyTreeToPaths, METH_O, __pyx_doc_9pyclipper_22PolyTreeToPaths};
static PyObject *__pyx_pw_9pyclipper_23PolyTreeToPaths(PyObject *__pyx_self, PyObject *__pyx_v_poly_node) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("PolyTreeToPaths (wrapper)", 0);
  __pyx_r = __pyx_pf_9pyclipper_22PolyTreeToPaths(__pyx_self, ((PyObject *)__pyx_v_poly_node));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pyclipper_22PolyTreeToPaths(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_poly_node) {
  PyObject *__pyx_v_paths = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_9pyclipper__filter_polynode __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("PolyTreeToPaths", 0);

  /* "pyclipper.pyx":444
 *     list of paths
 *     """
 *     paths = []             # <<<<<<<<<<<<<<
 *     _filter_polynode(poly_node, paths, filter_func=None)
 *     return paths
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_paths = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyclipper.pyx":445
 *     """
 *     paths = []
 *     _filter_polynode(poly_node, paths, filter_func=None)             # <<<<<<<<<<<<<<
 *     return paths
 * 
 */
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.filter_func = Py_None;
  __pyx_t_1 = __pyx_f_9pyclipper__filter_polynode(__pyx_v_poly_node, __pyx_v_paths, &__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyclipper.pyx":446
 *     paths = []
 *     _filter_polynode(poly_node, paths, filter_func=None)
 *     return paths             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_paths);
  __pyx_r = __pyx_v_paths;
  goto __pyx_L0;

  /* "pyclipper.pyx":434
 * 
 * 
 * def PolyTreeToPaths(poly_node):             # <<<<<<<<<<<<<<
 *     """ Converts a PyPolyNode to a list of paths.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/PolyTreeToPaths.htm
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyclipper.PolyTreeToPaths", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_paths);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":449
 * 
 * 
 * def ClosedPathsFromPolyTree(poly_node):             # <<<<<<<<<<<<<<
 *     """ Filters out open paths from the PyPolyNode and returns only closed paths.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/ClosedPathsFromPolyTree.htm
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pyclipper_25ClosedPathsFromPolyTree(PyObject *__pyx_self, PyObject *__pyx_v_poly_node); /*proto*/
static char __pyx_doc_9pyclipper_24ClosedPathsFromPolyTree[] = " Filters out open paths from the PyPolyNode and returns only closed paths.\n    More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/ClosedPathsFromPolyTree.htm\n\n    Keyword arguments:\n    py_poly_node -- PyPolyNode to be filtered\n\n    Returns:\n    list of closed paths\n    ";
static PyMethodDef __pyx_mdef_9pyclipper_25ClosedPathsFromPolyTree = {"ClosedPathsFromPolyTree", (PyCFunction)__pyx_pw_9pyclipper_25ClosedPathsFromPolyTree, METH_O, __pyx_doc_9pyclipper_24ClosedPathsFromPolyTree};
static PyObject *__pyx_pw_9pyclipper_25ClosedPathsFromPolyTree(PyObject *__pyx_self, PyObject *__pyx_v_poly_node) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ClosedPathsFromPolyTree (wrapper)", 0);
  __pyx_r = __pyx_pf_9pyclipper_24ClosedPathsFromPolyTree(__pyx_self, ((PyObject *)__pyx_v_poly_node));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":461
 * 
 *     paths = []
 *     _filter_polynode(poly_node, paths, filter_func=lambda pn: not pn.IsOpen)             # <<<<<<<<<<<<<<
 *     return paths
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pyclipper_23ClosedPathsFromPolyTree_lambda(PyObject *__pyx_self, PyObject *__pyx_v_pn); /*proto*/
static PyMethodDef __pyx_mdef_9pyclipper_23ClosedPathsFromPolyTree_lambda = {"lambda", (PyCFunction)__pyx_pw_9pyclipper_23ClosedPathsFromPolyTree_lambda, METH_O, 0};
static PyObject *__pyx_pw_9pyclipper_23ClosedPathsFromPolyTree_lambda(PyObject *__pyx_self, PyObject *__pyx_v_pn) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda(__pyx_self, ((PyObject *)__pyx_v_pn));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_lambda_funcdef_lambda(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_pn) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lambda", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pn, __pyx_n_s_IsOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong((!__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyclipper.ClosedPathsFromPolyTree.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":449
 * 
 * 
 * def ClosedPathsFromPolyTree(poly_node):             # <<<<<<<<<<<<<<
 *     """ Filters out open paths from the PyPolyNode and returns only closed paths.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/ClosedPathsFromPolyTree.htm
 */

static PyObject *__pyx_pf_9pyclipper_24ClosedPathsFromPolyTree(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_poly_node) {
  PyObject *__pyx_v_paths = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_9pyclipper__filter_polynode __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ClosedPathsFromPolyTree", 0);

  /* "pyclipper.pyx":460
 *     """
 * 
 *     paths = []             # <<<<<<<<<<<<<<
 *     _filter_polynode(poly_node, paths, filter_func=lambda pn: not pn.IsOpen)
 *     return paths
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_paths = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyclipper.pyx":461
 * 
 *     paths = []
 *     _filter_polynode(poly_node, paths, filter_func=lambda pn: not pn.IsOpen)             # <<<<<<<<<<<<<<
 *     return paths
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9pyclipper_23ClosedPathsFromPolyTree_lambda, 0, __pyx_n_s_ClosedPathsFromPolyTree_locals_l, NULL, __pyx_n_s_pyclipper, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.filter_func = __pyx_t_1;
  __pyx_t_2 = __pyx_f_9pyclipper__filter_polynode(__pyx_v_poly_node, __pyx_v_paths, &__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyclipper.pyx":462
 *     paths = []
 *     _filter_polynode(poly_node, paths, filter_func=lambda pn: not pn.IsOpen)
 *     return paths             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_paths);
  __pyx_r = __pyx_v_paths;
  goto __pyx_L0;

  /* "pyclipper.pyx":449
 * 
 * 
 * def ClosedPathsFromPolyTree(poly_node):             # <<<<<<<<<<<<<<
 *     """ Filters out open paths from the PyPolyNode and returns only closed paths.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/ClosedPathsFromPolyTree.htm
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyclipper.ClosedPathsFromPolyTree", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_paths);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":465
 * 
 * 
 * def OpenPathsFromPolyTree(poly_node):             # <<<<<<<<<<<<<<
 *     """ Filters out closed paths from the PyPolyNode and returns only open paths.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/OpenPathsFromPolyTree.htm
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pyclipper_27OpenPathsFromPolyTree(PyObject *__pyx_self, PyObject *__pyx_v_poly_node); /*proto*/
static char __pyx_doc_9pyclipper_26OpenPathsFromPolyTree[] = " Filters out closed paths from the PyPolyNode and returns only open paths.\n    More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/OpenPathsFromPolyTree.htm\n\n    Keyword arguments:\n    py_poly_node -- PyPolyNode to be filtered\n\n    Returns:\n    list of open paths\n    ";
static PyMethodDef __pyx_mdef_9pyclipper_27OpenPathsFromPolyTree = {"OpenPathsFromPolyTree", (PyCFunction)__pyx_pw_9pyclipper_27OpenPathsFromPolyTree, METH_O, __pyx_doc_9pyclipper_26OpenPathsFromPolyTree};
static PyObject *__pyx_pw_9pyclipper_27OpenPathsFromPolyTree(PyObject *__pyx_self, PyObject *__pyx_v_poly_node) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("OpenPathsFromPolyTree (wrapper)", 0);
  __pyx_r = __pyx_pf_9pyclipper_26OpenPathsFromPolyTree(__pyx_self, ((PyObject *)__pyx_v_poly_node));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":476
 *     """
 *     paths = []
 *     _filter_polynode(poly_node, paths, filter_func=lambda pn: pn.IsOpen)             # <<<<<<<<<<<<<<
 *     return paths
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pyclipper_21OpenPathsFromPolyTree_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_pn); /*proto*/
static PyMethodDef __pyx_mdef_9pyclipper_21OpenPathsFromPolyTree_lambda1 = {"lambda1", (PyCFunction)__pyx_pw_9pyclipper_21OpenPathsFromPolyTree_lambda1, METH_O, 0};
static PyObject *__pyx_pw_9pyclipper_21OpenPathsFromPolyTree_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_pn) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda1 (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_lambda1(__pyx_self, ((PyObject *)__pyx_v_pn));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_lambda_funcdef_lambda1(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_pn) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("lambda1", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pn, __pyx_n_s_IsOpen); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyclipper.OpenPathsFromPolyTree.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":465
 * 
 * 
 * def OpenPathsFromPolyTree(poly_node):             # <<<<<<<<<<<<<<
 *     """ Filters out closed paths from the PyPolyNode and returns only open paths.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/OpenPathsFromPolyTree.htm
 */

static PyObject *__pyx_pf_9pyclipper_26OpenPathsFromPolyTree(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_poly_node) {
  PyObject *__pyx_v_paths = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_9pyclipper__filter_polynode __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("OpenPathsFromPolyTree", 0);

  /* "pyclipper.pyx":475
 *     list of open paths
 *     """
 *     paths = []             # <<<<<<<<<<<<<<
 *     _filter_polynode(poly_node, paths, filter_func=lambda pn: pn.IsOpen)
 *     return paths
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_paths = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyclipper.pyx":476
 *     """
 *     paths = []
 *     _filter_polynode(poly_node, paths, filter_func=lambda pn: pn.IsOpen)             # <<<<<<<<<<<<<<
 *     return paths
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9pyclipper_21OpenPathsFromPolyTree_lambda1, 0, __pyx_n_s_OpenPathsFromPolyTree_locals_lam, NULL, __pyx_n_s_pyclipper, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3.__pyx_n = 1;
  __pyx_t_3.filter_func = __pyx_t_1;
  __pyx_t_2 = __pyx_f_9pyclipper__filter_polynode(__pyx_v_poly_node, __pyx_v_paths, &__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyclipper.pyx":477
 *     paths = []
 *     _filter_polynode(poly_node, paths, filter_func=lambda pn: pn.IsOpen)
 *     return paths             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_paths);
  __pyx_r = __pyx_v_paths;
  goto __pyx_L0;

  /* "pyclipper.pyx":465
 * 
 * 
 * def OpenPathsFromPolyTree(poly_node):             # <<<<<<<<<<<<<<
 *     """ Filters out closed paths from the PyPolyNode and returns only open paths.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/OpenPathsFromPolyTree.htm
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyclipper.OpenPathsFromPolyTree", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_paths);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":480
 * 
 * 
 * def ReversePath(path):             # <<<<<<<<<<<<<<
 *     """ Reverses the vertex order (and hence orientation) in the specified path.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/ReversePath.htm
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pyclipper_29ReversePath(PyObject *__pyx_self, PyObject *__pyx_v_path); /*proto*/
static char __pyx_doc_9pyclipper_28ReversePath[] = " Reverses the vertex order (and hence orientation) in the specified path.\n    More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/ReversePath.htm\n\n    Note: Might be more effective to reverse the path outside of this package (eg. via [::-1] on a list)\n    so there is no unneeded conversions to internal structures of this package.\n\n    Keyword arguments:\n    path -- path to be reversed\n\n    Returns:\n    reversed path\n    ";
static PyMethodDef __pyx_mdef_9pyclipper_29ReversePath = {"ReversePath", (PyCFunction)__pyx_pw_9pyclipper_29ReversePath, METH_O, __pyx_doc_9pyclipper_28ReversePath};
static PyObject *__pyx_pw_9pyclipper_29ReversePath(PyObject *__pyx_self, PyObject *__pyx_v_path) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReversePath (wrapper)", 0);
  __pyx_r = __pyx_pf_9pyclipper_28ReversePath(__pyx_self, ((PyObject *)__pyx_v_path));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pyclipper_28ReversePath(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path) {
  ClipperLib::Path __pyx_v_c_path;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ReversePath", 0);

  /* "pyclipper.pyx":493
 *     reversed path
 *     """
 *     cdef Path c_path = _to_clipper_path(path)             # <<<<<<<<<<<<<<
 *     c_ReversePath(c_path)
 *     return _from_clipper_path(c_path)
 */
  __pyx_v_c_path = __pyx_f_9pyclipper__to_clipper_path(__pyx_v_path);

  /* "pyclipper.pyx":494
 *     """
 *     cdef Path c_path = _to_clipper_path(path)
 *     c_ReversePath(c_path)             # <<<<<<<<<<<<<<
 *     return _from_clipper_path(c_path)
 * 
 */
  ReversePath(__pyx_v_c_path);

  /* "pyclipper.pyx":495
 *     cdef Path c_path = _to_clipper_path(path)
 *     c_ReversePath(c_path)
 *     return _from_clipper_path(c_path)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pyclipper__from_clipper_path(__pyx_v_c_path); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyclipper.pyx":480
 * 
 * 
 * def ReversePath(path):             # <<<<<<<<<<<<<<
 *     """ Reverses the vertex order (and hence orientation) in the specified path.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/ReversePath.htm
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyclipper.ReversePath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":498
 * 
 * 
 * def ReversePaths(paths):             # <<<<<<<<<<<<<<
 *     """ Reverses the vertex order (and hence orientation) in each path.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/ReversePaths.htm
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pyclipper_31ReversePaths(PyObject *__pyx_self, PyObject *__pyx_v_paths); /*proto*/
static char __pyx_doc_9pyclipper_30ReversePaths[] = " Reverses the vertex order (and hence orientation) in each path.\n    More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/ReversePaths.htm\n\n    Note: Might be more effective to reverse each path outside of this package (eg. via [::-1] on a list)\n    so there is no unneeded conversions to internal structures of this package.\n\n    Keyword arguments:\n    paths -- paths to be reversed\n\n    Returns:\n    list if reversed paths\n    ";
static PyMethodDef __pyx_mdef_9pyclipper_31ReversePaths = {"ReversePaths", (PyCFunction)__pyx_pw_9pyclipper_31ReversePaths, METH_O, __pyx_doc_9pyclipper_30ReversePaths};
static PyObject *__pyx_pw_9pyclipper_31ReversePaths(PyObject *__pyx_self, PyObject *__pyx_v_paths) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ReversePaths (wrapper)", 0);
  __pyx_r = __pyx_pf_9pyclipper_30ReversePaths(__pyx_self, ((PyObject *)__pyx_v_paths));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pyclipper_30ReversePaths(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_paths) {
  ClipperLib::Paths __pyx_v_c_paths;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ReversePaths", 0);

  /* "pyclipper.pyx":511
 *     list if reversed paths
 *     """
 *     cdef Paths c_paths = _to_clipper_paths(paths)             # <<<<<<<<<<<<<<
 *     c_ReversePaths(c_paths)
 *     return _from_clipper_paths(c_paths)
 */
  __pyx_v_c_paths = __pyx_f_9pyclipper__to_clipper_paths(__pyx_v_paths);

  /* "pyclipper.pyx":512
 *     """
 *     cdef Paths c_paths = _to_clipper_paths(paths)
 *     c_ReversePaths(c_paths)             # <<<<<<<<<<<<<<
 *     return _from_clipper_paths(c_paths)
 * 
 */
  ReversePaths(__pyx_v_c_paths);

  /* "pyclipper.pyx":513
 *     cdef Paths c_paths = _to_clipper_paths(paths)
 *     c_ReversePaths(c_paths)
 *     return _from_clipper_paths(c_paths)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pyclipper__from_clipper_paths(__pyx_v_c_paths); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyclipper.pyx":498
 * 
 * 
 * def ReversePaths(paths):             # <<<<<<<<<<<<<<
 *     """ Reverses the vertex order (and hence orientation) in each path.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/ReversePaths.htm
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyclipper.ReversePaths", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":516
 * 
 * 
 * def scale_to_clipper(path_or_paths, scale = 2 ** 31):             # <<<<<<<<<<<<<<
 *     """
 *     Take a path or list of paths with coordinates represented by floats and scale them using the specified factor. This function can be user to convert paths to a representation which is more appropriate for Clipper.
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pyclipper_33scale_to_clipper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pyclipper_32scale_to_clipper[] = "\n    Take a path or list of paths with coordinates represented by floats and scale them using the specified factor. This function can be user to convert paths to a representation which is more appropriate for Clipper.\n    \n    Clipper, and thus Pyclipper, uses 64-bit integers to represent coordinates internally. The actual supported range (+/- 2 ** 62) is a bit smaller than the maximal values for this type. To operate on paths which use fractional coordinates, it is necessary to translate them from and to a representation which does not depend on floats. This can be done using this function and it's reverse, `scale_from_clipper()`.\n    \n    For details, see http://www.angusj.com/delphi/clipper/documentation/Docs/Overview/Rounding.htm.\n    \n    For example, to perform a clip operation on two polygons, the arguments to `Pyclipper.AddPath()` need to be wrapped in `scale_to_clipper()` while the return value needs to be converted back with `scale_from_clipper()`:\n    \n    >>> pc = Pyclipper()\n    >>> path = [[0, 0], [1, 0], [1 / 2, (3 / 4) ** (1 / 2)]] # A triangle.\n    >>> clip = [[0, 1 / 3], [1, 1 / 3], [1, 2 / 3], [0, 1 / 3]] # A rectangle.\n    >>> pc.AddPath(scale_to_clipper(path), PT_SUBJECT)\n    >>> pc.AddPath(scale_to_clipper(clip), PT_CLIP)\n    >>> scale_from_clipper(pc.Execute(CT_INTERSECTION))\n    [[[0.6772190444171429, 0.5590730146504939], [0.2383135547861457, 0.41277118446305394], [0.19245008938014507, 0.3333333330228925], [0.8075499106198549, 0.3333333330228925]]]\n    \n    :param path_or_paths: Either a list of paths or a path. A path is a list of tuples of numbers.\n    :param scale: The factor with which to multiply coordinates before converting rounding them to ints. The default will give you a range of +/- 2 ** 31 with a precision of 2 ** -31.\n    ";
static PyMethodDef __pyx_mdef_9pyclipper_33scale_to_clipper = {"scale_to_clipper", (PyCFunction)__pyx_pw_9pyclipper_33scale_to_clipper, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pyclipper_32scale_to_clipper};
static PyObject *__pyx_pw_9pyclipper_33scale_to_clipper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path_or_paths = 0;
  PyObject *__pyx_v_scale = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scale_to_clipper (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path_or_paths,&__pyx_n_s_scale,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)__pyx_int_2147483648);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_path_or_paths)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_scale);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scale_to_clipper") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_path_or_paths = values[0];
    __pyx_v_scale = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scale_to_clipper", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyclipper.scale_to_clipper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pyclipper_32scale_to_clipper(__pyx_self, __pyx_v_path_or_paths, __pyx_v_scale);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":538
 *     """
 * 
 *     def scale_value(x):             # <<<<<<<<<<<<<<
 *         if isinstance(x, _numbers.Real):
 *             return <cInt>(<double>x * scale)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pyclipper_16scale_to_clipper_1scale_value(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static PyMethodDef __pyx_mdef_9pyclipper_16scale_to_clipper_1scale_value = {"scale_value", (PyCFunction)__pyx_pw_9pyclipper_16scale_to_clipper_1scale_value, METH_O, 0};
static PyObject *__pyx_pw_9pyclipper_16scale_to_clipper_1scale_value(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scale_value (wrapper)", 0);
  __pyx_r = __pyx_pf_9pyclipper_16scale_to_clipper_scale_value(__pyx_self, ((PyObject *)__pyx_v_x));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pyclipper_16scale_to_clipper_scale_value(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  struct __pyx_obj_9pyclipper___pyx_scope_struct__scale_to_clipper *__pyx_cur_scope;
  struct __pyx_obj_9pyclipper___pyx_scope_struct__scale_to_clipper *__pyx_outer_scope;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  double __pyx_t_5;
  ClipperLib::cInt __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scale_value", 0);
  __pyx_outer_scope = (struct __pyx_obj_9pyclipper___pyx_scope_struct__scale_to_clipper *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "pyclipper.pyx":539
 * 
 *     def scale_value(x):
 *         if isinstance(x, _numbers.Real):             # <<<<<<<<<<<<<<
 *             return <cInt>(<double>x * scale)
 *         else:
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numbers); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Real); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_x, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "pyclipper.pyx":540
 *     def scale_value(x):
 *         if isinstance(x, _numbers.Real):
 *             return <cInt>(<double>x * scale)             # <<<<<<<<<<<<<<
 *         else:
 *             return [scale_value(i) for i in x]
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_x); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = PyFloat_FromDouble(((double)__pyx_t_5)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(!__pyx_cur_scope->__pyx_v_scale)) { __Pyx_RaiseClosureNameError("scale"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_cur_scope->__pyx_v_scale); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = __Pyx_PyInt_As_ClipperLib_3a__3a_cInt(__pyx_t_1); if (unlikely((__pyx_t_6 == (ClipperLib::cInt)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyInt_From_ClipperLib_3a__3a_cInt(((ClipperLib::cInt)__pyx_t_6)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "pyclipper.pyx":539
 * 
 *     def scale_value(x):
 *         if isinstance(x, _numbers.Real):             # <<<<<<<<<<<<<<
 *             return <cInt>(<double>x * scale)
 *         else:
 */
  }

  /* "pyclipper.pyx":542
 *             return <cInt>(<double>x * scale)
 *         else:
 *             return [scale_value(i) for i in x]             # <<<<<<<<<<<<<<
 * 
 *     return scale_value(path_or_paths)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (likely(PyList_CheckExact(__pyx_v_x)) || PyTuple_CheckExact(__pyx_v_x)) {
      __pyx_t_2 = __pyx_v_x; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_x); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    for (;;) {
      if (likely(!__pyx_t_8)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_9 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_9 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_9);
          #endif
        } else {
          if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_9 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_9);
          #endif
        }
      } else {
        __pyx_t_9 = __pyx_t_8(__pyx_t_2);
        if (unlikely(!__pyx_t_9)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_9);
      }
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_9);
      __pyx_t_9 = 0;
      if (unlikely(!__pyx_cur_scope->__pyx_v_scale_value)) { __Pyx_RaiseClosureNameError("scale_value"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
      __pyx_t_9 = __pyx_pf_9pyclipper_16scale_to_clipper_scale_value(__pyx_cur_scope->__pyx_v_scale_value, __pyx_v_i); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_9))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "pyclipper.pyx":538
 *     """
 * 
 *     def scale_value(x):             # <<<<<<<<<<<<<<
 *         if isinstance(x, _numbers.Real):
 *             return <cInt>(<double>x * scale)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pyclipper.scale_to_clipper.scale_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":516
 * 
 * 
 * def scale_to_clipper(path_or_paths, scale = 2 ** 31):             # <<<<<<<<<<<<<<
 *     """
 *     Take a path or list of paths with coordinates represented by floats and scale them using the specified factor. This function can be user to convert paths to a representation which is more appropriate for Clipper.
 */

static PyObject *__pyx_pf_9pyclipper_32scale_to_clipper(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path_or_paths, PyObject *__pyx_v_scale) {
  struct __pyx_obj_9pyclipper___pyx_scope_struct__scale_to_clipper *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scale_to_clipper", 0);
  __pyx_cur_scope = (struct __pyx_obj_9pyclipper___pyx_scope_struct__scale_to_clipper *)__pyx_tp_new_9pyclipper___pyx_scope_struct__scale_to_clipper(__pyx_ptype_9pyclipper___pyx_scope_struct__scale_to_clipper, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_scale = __pyx_v_scale;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_scale);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_scale);

  /* "pyclipper.pyx":538
 *     """
 * 
 *     def scale_value(x):             # <<<<<<<<<<<<<<
 *         if isinstance(x, _numbers.Real):
 *             return <cInt>(<double>x * scale)
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9pyclipper_16scale_to_clipper_1scale_value, 0, __pyx_n_s_scale_to_clipper_locals_scale_va, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pyclipper, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_scale_value = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyclipper.pyx":544
 *             return [scale_value(i) for i in x]
 * 
 *     return scale_value(path_or_paths)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_pf_9pyclipper_16scale_to_clipper_scale_value(__pyx_cur_scope->__pyx_v_scale_value, __pyx_v_path_or_paths); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 544; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyclipper.pyx":516
 * 
 * 
 * def scale_to_clipper(path_or_paths, scale = 2 ** 31):             # <<<<<<<<<<<<<<
 *     """
 *     Take a path or list of paths with coordinates represented by floats and scale them using the specified factor. This function can be user to convert paths to a representation which is more appropriate for Clipper.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyclipper.scale_to_clipper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":547
 * 
 * 
 * def scale_from_clipper(path_or_paths, scale = 2 ** 31):             # <<<<<<<<<<<<<<
 *     """
 *     Take a path or list of paths with coordinates represented by ints and scale them back to a fractional representation. This function does the inverse of `scale_to_clipper()`.
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pyclipper_35scale_from_clipper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pyclipper_34scale_from_clipper[] = "\n    Take a path or list of paths with coordinates represented by ints and scale them back to a fractional representation. This function does the inverse of `scale_to_clipper()`.\n    \n    :param path_or_paths: Either a list of paths or a path. A path is a list of tuples of numbers.\n    :param scale: The factor by which to divide coordinates when converting them to floats.\n    ";
static PyMethodDef __pyx_mdef_9pyclipper_35scale_from_clipper = {"scale_from_clipper", (PyCFunction)__pyx_pw_9pyclipper_35scale_from_clipper, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pyclipper_34scale_from_clipper};
static PyObject *__pyx_pw_9pyclipper_35scale_from_clipper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path_or_paths = 0;
  PyObject *__pyx_v_scale = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scale_from_clipper (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path_or_paths,&__pyx_n_s_scale,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)__pyx_int_2147483648);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_path_or_paths)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_scale);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "scale_from_clipper") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_path_or_paths = values[0];
    __pyx_v_scale = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("scale_from_clipper", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyclipper.scale_from_clipper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pyclipper_34scale_from_clipper(__pyx_self, __pyx_v_path_or_paths, __pyx_v_scale);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":555
 *     """
 * 
 *     def scale_value(x):             # <<<<<<<<<<<<<<
 *         if isinstance(x, _numbers.Real):
 *             return <double>x / scale
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pyclipper_18scale_from_clipper_1scale_value(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
static PyMethodDef __pyx_mdef_9pyclipper_18scale_from_clipper_1scale_value = {"scale_value", (PyCFunction)__pyx_pw_9pyclipper_18scale_from_clipper_1scale_value, METH_O, 0};
static PyObject *__pyx_pw_9pyclipper_18scale_from_clipper_1scale_value(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("scale_value (wrapper)", 0);
  __pyx_r = __pyx_pf_9pyclipper_18scale_from_clipper_scale_value(__pyx_self, ((PyObject *)__pyx_v_x));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pyclipper_18scale_from_clipper_scale_value(PyObject *__pyx_self, PyObject *__pyx_v_x) {
  struct __pyx_obj_9pyclipper___pyx_scope_struct_1_scale_from_clipper *__pyx_cur_scope;
  struct __pyx_obj_9pyclipper___pyx_scope_struct_1_scale_from_clipper *__pyx_outer_scope;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  double __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scale_value", 0);
  __pyx_outer_scope = (struct __pyx_obj_9pyclipper___pyx_scope_struct_1_scale_from_clipper *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "pyclipper.pyx":556
 * 
 *     def scale_value(x):
 *         if isinstance(x, _numbers.Real):             # <<<<<<<<<<<<<<
 *             return <double>x / scale
 *         else:
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numbers); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Real); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_x, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 556; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "pyclipper.pyx":557
 *     def scale_value(x):
 *         if isinstance(x, _numbers.Real):
 *             return <double>x / scale             # <<<<<<<<<<<<<<
 *         else:
 *             return [scale_value(i) for i in x]
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_x); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = PyFloat_FromDouble(((double)__pyx_t_5)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(!__pyx_cur_scope->__pyx_v_scale)) { __Pyx_RaiseClosureNameError("scale"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
    __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_cur_scope->__pyx_v_scale); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "pyclipper.pyx":556
 * 
 *     def scale_value(x):
 *         if isinstance(x, _numbers.Real):             # <<<<<<<<<<<<<<
 *             return <double>x / scale
 *         else:
 */
  }

  /* "pyclipper.pyx":559
 *             return <double>x / scale
 *         else:
 *             return [scale_value(i) for i in x]             # <<<<<<<<<<<<<<
 * 
 *     return scale_value(path_or_paths)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (likely(PyList_CheckExact(__pyx_v_x)) || PyTuple_CheckExact(__pyx_v_x)) {
      __pyx_t_2 = __pyx_v_x; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_x); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_8 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_8); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_8 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_8);
          #endif
        }
      } else {
        __pyx_t_8 = __pyx_t_7(__pyx_t_2);
        if (unlikely(!__pyx_t_8)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_8);
      }
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_8);
      __pyx_t_8 = 0;
      if (unlikely(!__pyx_cur_scope->__pyx_v_scale_value)) { __Pyx_RaiseClosureNameError("scale_value"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
      __pyx_t_8 = __pyx_pf_9pyclipper_18scale_from_clipper_scale_value(__pyx_cur_scope->__pyx_v_scale_value, __pyx_v_i); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_8))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 559; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "pyclipper.pyx":555
 *     """
 * 
 *     def scale_value(x):             # <<<<<<<<<<<<<<
 *         if isinstance(x, _numbers.Real):
 *             return <double>x / scale
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pyclipper.scale_from_clipper.scale_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":547
 * 
 * 
 * def scale_from_clipper(path_or_paths, scale = 2 ** 31):             # <<<<<<<<<<<<<<
 *     """
 *     Take a path or list of paths with coordinates represented by ints and scale them back to a fractional representation. This function does the inverse of `scale_to_clipper()`.
 */

static PyObject *__pyx_pf_9pyclipper_34scale_from_clipper(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_path_or_paths, PyObject *__pyx_v_scale) {
  struct __pyx_obj_9pyclipper___pyx_scope_struct_1_scale_from_clipper *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("scale_from_clipper", 0);
  __pyx_cur_scope = (struct __pyx_obj_9pyclipper___pyx_scope_struct_1_scale_from_clipper *)__pyx_tp_new_9pyclipper___pyx_scope_struct_1_scale_from_clipper(__pyx_ptype_9pyclipper___pyx_scope_struct_1_scale_from_clipper, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_scale = __pyx_v_scale;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_scale);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_scale);

  /* "pyclipper.pyx":555
 *     """
 * 
 *     def scale_value(x):             # <<<<<<<<<<<<<<
 *         if isinstance(x, _numbers.Real):
 *             return <double>x / scale
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9pyclipper_18scale_from_clipper_1scale_value, 0, __pyx_n_s_scale_from_clipper_locals_scale, ((PyObject*)__pyx_cur_scope), __pyx_n_s_pyclipper, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_cur_scope->__pyx_v_scale_value = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyclipper.pyx":561
 *             return [scale_value(i) for i in x]
 * 
 *     return scale_value(path_or_paths)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_pf_9pyclipper_18scale_from_clipper_scale_value(__pyx_cur_scope->__pyx_v_scale_value, __pyx_v_path_or_paths); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyclipper.pyx":547
 * 
 * 
 * def scale_from_clipper(path_or_paths, scale = 2 ** 31):             # <<<<<<<<<<<<<<
 *     """
 *     Take a path or list of paths with coordinates represented by ints and scale them back to a fractional representation. This function does the inverse of `scale_to_clipper()`.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyclipper.scale_from_clipper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":571
 *     """
 *     cdef Clipper *thisptr  # hold a C++ instance which we're wrapping
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         """ Creates an instance of the Clipper class. InitOptions from the Clipper class
 *         are substituted with separate properties.
 */

/* Python wrapper */
static int __pyx_pw_9pyclipper_9Pyclipper_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9pyclipper_9Pyclipper_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_9pyclipper_9Pyclipper___cinit__(((struct __pyx_obj_9pyclipper_Pyclipper *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9pyclipper_9Pyclipper___cinit__(struct __pyx_obj_9pyclipper_Pyclipper *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyclipper.pyx":578
 *         """
 * 
 *         log_action("Creating a Clipper instance")             # <<<<<<<<<<<<<<
 *         self.thisptr = new Clipper()
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_log_action); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyclipper.pyx":579
 * 
 *         log_action("Creating a Clipper instance")
 *         self.thisptr = new Clipper()             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_v_self->thisptr = new ClipperLib::Clipper(NULL);

  /* "pyclipper.pyx":571
 *     """
 *     cdef Clipper *thisptr  # hold a C++ instance which we're wrapping
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         """ Creates an instance of the Clipper class. InitOptions from the Clipper class
 *         are substituted with separate properties.
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyclipper.Pyclipper.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":581
 *         self.thisptr = new Clipper()
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         log_action("Deleting the Clipper instance")
 *         del self.thisptr
 */

/* Python wrapper */
static void __pyx_pw_9pyclipper_9Pyclipper_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_9pyclipper_9Pyclipper_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_9pyclipper_9Pyclipper_2__dealloc__(((struct __pyx_obj_9pyclipper_Pyclipper *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_9pyclipper_9Pyclipper_2__dealloc__(struct __pyx_obj_9pyclipper_Pyclipper *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pyclipper.pyx":582
 * 
 *     def __dealloc__(self):
 *         log_action("Deleting the Clipper instance")             # <<<<<<<<<<<<<<
 *         del self.thisptr
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_log_action); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyclipper.pyx":583
 *     def __dealloc__(self):
 *         log_action("Deleting the Clipper instance")
 *         del self.thisptr             # <<<<<<<<<<<<<<
 * 
 *     def AddPath(self, path, PolyType poly_type, closed=True):
 */
  delete __pyx_v_self->thisptr;

  /* "pyclipper.pyx":581
 *         self.thisptr = new Clipper()
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         log_action("Deleting the Clipper instance")
 *         del self.thisptr
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("pyclipper.Pyclipper.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyclipper.pyx":585
 *         del self.thisptr
 * 
 *     def AddPath(self, path, PolyType poly_type, closed=True):             # <<<<<<<<<<<<<<
 *         """ Add individual path.
 *         More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/ClipperBase/Methods/AddPath.htm
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pyclipper_9Pyclipper_5AddPath(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pyclipper_9Pyclipper_4AddPath[] = " Add individual path.\n        More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/ClipperBase/Methods/AddPath.htm\n\n        Keyword arguments:\n        path      -- path to be added\n        poly_type -- type of the added path - subject or clip\n        closed    -- True if the added path is closed, False if open\n\n        Returns:\n        True -- path is valid for clipping and was added\n\n        Raises:\n        ClipperException -- if path is invalid for clipping\n        ";
static PyObject *__pyx_pw_9pyclipper_9Pyclipper_5AddPath(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  enum ClipperLib::PolyType __pyx_v_poly_type;
  PyObject *__pyx_v_closed = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("AddPath (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_poly_type,&__pyx_n_s_closed,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_True);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_poly_type)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("AddPath", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_closed);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "AddPath") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_path = values[0];
    __pyx_v_poly_type = ((enum ClipperLib::PolyType)__Pyx_PyInt_As_enum__ClipperLib_3a__3a_PolyType(values[1])); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_closed = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("AddPath", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyclipper.Pyclipper.AddPath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pyclipper_9Pyclipper_4AddPath(((struct __pyx_obj_9pyclipper_Pyclipper *)__pyx_v_self), __pyx_v_path, __pyx_v_poly_type, __pyx_v_closed);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pyclipper_9Pyclipper_4AddPath(struct __pyx_obj_9pyclipper_Pyclipper *__pyx_v_self, PyObject *__pyx_v_path, enum ClipperLib::PolyType __pyx_v_poly_type, PyObject *__pyx_v_closed) {
  ClipperLib::Path __pyx_v_c_path;
  int __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("AddPath", 0);

  /* "pyclipper.pyx":600
 *         ClipperException -- if path is invalid for clipping
 *         """
 *         cdef Path c_path = _to_clipper_path(path)             # <<<<<<<<<<<<<<
 *         cdef bint result = <bint> self.thisptr.AddPath(c_path, poly_type, <bint> closed)
 *         if not result:
 */
  __pyx_v_c_path = __pyx_f_9pyclipper__to_clipper_path(__pyx_v_path);

  /* "pyclipper.pyx":601
 *         """
 *         cdef Path c_path = _to_clipper_path(path)
 *         cdef bint result = <bint> self.thisptr.AddPath(c_path, poly_type, <bint> closed)             # <<<<<<<<<<<<<<
 *         if not result:
 *             raise ClipperException('The path is invalid for clipping')
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_closed); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_result = (__pyx_v_self->thisptr->AddPath(__pyx_v_c_path, __pyx_v_poly_type, __pyx_t_1) != 0);

  /* "pyclipper.pyx":602
 *         cdef Path c_path = _to_clipper_path(path)
 *         cdef bint result = <bint> self.thisptr.AddPath(c_path, poly_type, <bint> closed)
 *         if not result:             # <<<<<<<<<<<<<<
 *             raise ClipperException('The path is invalid for clipping')
 *         return result
 */
  __pyx_t_1 = ((!(__pyx_v_result != 0)) != 0);
  if (__pyx_t_1) {

    /* "pyclipper.pyx":603
 *         cdef bint result = <bint> self.thisptr.AddPath(c_path, poly_type, <bint> closed)
 *         if not result:
 *             raise ClipperException('The path is invalid for clipping')             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ClipperException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pyclipper.pyx":602
 *         cdef Path c_path = _to_clipper_path(path)
 *         cdef bint result = <bint> self.thisptr.AddPath(c_path, poly_type, <bint> closed)
 *         if not result:             # <<<<<<<<<<<<<<
 *             raise ClipperException('The path is invalid for clipping')
 *         return result
 */
  }

  /* "pyclipper.pyx":604
 *         if not result:
 *             raise ClipperException('The path is invalid for clipping')
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def AddPaths(self, paths, PolyType poly_type, closed=True):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyclipper.pyx":585
 *         del self.thisptr
 * 
 *     def AddPath(self, path, PolyType poly_type, closed=True):             # <<<<<<<<<<<<<<
 *         """ Add individual path.
 *         More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/ClipperBase/Methods/AddPath.htm
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyclipper.Pyclipper.AddPath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":606
 *         return result
 * 
 *     def AddPaths(self, paths, PolyType poly_type, closed=True):             # <<<<<<<<<<<<<<
 *         """ Add a list of paths.
 *         More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/ClipperBase/Methods/AddPaths.htm
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pyclipper_9Pyclipper_7AddPaths(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pyclipper_9Pyclipper_6AddPaths[] = " Add a list of paths.\n        More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/ClipperBase/Methods/AddPaths.htm\n\n        Keyword arguments:\n        paths     -- paths to be added\n        poly_type -- type of added paths - subject or clip\n        closed    -- True if added paths are closed, False if open\n\n        Returns:\n        True -- all or some paths are valid for clipping and were added\n\n        Raises:\n        ClipperException -- all paths are invalid for clipping\n        ";
static PyObject *__pyx_pw_9pyclipper_9Pyclipper_7AddPaths(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_paths = 0;
  enum ClipperLib::PolyType __pyx_v_poly_type;
  PyObject *__pyx_v_closed = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("AddPaths (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_paths,&__pyx_n_s_poly_type,&__pyx_n_s_closed,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_True);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_paths)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_poly_type)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("AddPaths", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_closed);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "AddPaths") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_paths = values[0];
    __pyx_v_poly_type = ((enum ClipperLib::PolyType)__Pyx_PyInt_As_enum__ClipperLib_3a__3a_PolyType(values[1])); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_closed = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("AddPaths", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 606; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyclipper.Pyclipper.AddPaths", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pyclipper_9Pyclipper_6AddPaths(((struct __pyx_obj_9pyclipper_Pyclipper *)__pyx_v_self), __pyx_v_paths, __pyx_v_poly_type, __pyx_v_closed);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pyclipper_9Pyclipper_6AddPaths(struct __pyx_obj_9pyclipper_Pyclipper *__pyx_v_self, PyObject *__pyx_v_paths, enum ClipperLib::PolyType __pyx_v_poly_type, PyObject *__pyx_v_closed) {
  ClipperLib::Paths __pyx_v_c_paths;
  int __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("AddPaths", 0);

  /* "pyclipper.pyx":621
 *         ClipperException -- all paths are invalid for clipping
 *         """
 *         cdef Paths c_paths = _to_clipper_paths(paths)             # <<<<<<<<<<<<<<
 *         cdef bint result = <bint> self.thisptr.AddPaths(c_paths, poly_type, <bint> closed)
 *         if not result:
 */
  __pyx_v_c_paths = __pyx_f_9pyclipper__to_clipper_paths(__pyx_v_paths);

  /* "pyclipper.pyx":622
 *         """
 *         cdef Paths c_paths = _to_clipper_paths(paths)
 *         cdef bint result = <bint> self.thisptr.AddPaths(c_paths, poly_type, <bint> closed)             # <<<<<<<<<<<<<<
 *         if not result:
 *             raise ClipperException('All paths are invalid for clipping')
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_closed); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 622; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_result = (__pyx_v_self->thisptr->AddPaths(__pyx_v_c_paths, __pyx_v_poly_type, __pyx_t_1) != 0);

  /* "pyclipper.pyx":623
 *         cdef Paths c_paths = _to_clipper_paths(paths)
 *         cdef bint result = <bint> self.thisptr.AddPaths(c_paths, poly_type, <bint> closed)
 *         if not result:             # <<<<<<<<<<<<<<
 *             raise ClipperException('All paths are invalid for clipping')
 *         return result
 */
  __pyx_t_1 = ((!(__pyx_v_result != 0)) != 0);
  if (__pyx_t_1) {

    /* "pyclipper.pyx":624
 *         cdef bint result = <bint> self.thisptr.AddPaths(c_paths, poly_type, <bint> closed)
 *         if not result:
 *             raise ClipperException('All paths are invalid for clipping')             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ClipperException); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pyclipper.pyx":623
 *         cdef Paths c_paths = _to_clipper_paths(paths)
 *         cdef bint result = <bint> self.thisptr.AddPaths(c_paths, poly_type, <bint> closed)
 *         if not result:             # <<<<<<<<<<<<<<
 *             raise ClipperException('All paths are invalid for clipping')
 *         return result
 */
  }

  /* "pyclipper.pyx":625
 *         if not result:
 *             raise ClipperException('All paths are invalid for clipping')
 *         return result             # <<<<<<<<<<<<<<
 * 
 *     def Clear(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_result); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyclipper.pyx":606
 *         return result
 * 
 *     def AddPaths(self, paths, PolyType poly_type, closed=True):             # <<<<<<<<<<<<<<
 *         """ Add a list of paths.
 *         More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/ClipperBase/Methods/AddPaths.htm
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyclipper.Pyclipper.AddPaths", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":627
 *         return result
 * 
 *     def Clear(self):             # <<<<<<<<<<<<<<
 *         """ Removes all subject and clip polygons.
 *         More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/ClipperBase/Methods/Clear.htm
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pyclipper_9Pyclipper_9Clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pyclipper_9Pyclipper_8Clear[] = " Removes all subject and clip polygons.\n        More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/ClipperBase/Methods/Clear.htm\n        ";
static PyObject *__pyx_pw_9pyclipper_9Pyclipper_9Clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Clear (wrapper)", 0);
  __pyx_r = __pyx_pf_9pyclipper_9Pyclipper_8Clear(((struct __pyx_obj_9pyclipper_Pyclipper *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pyclipper_9Pyclipper_8Clear(struct __pyx_obj_9pyclipper_Pyclipper *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Clear", 0);

  /* "pyclipper.pyx":631
 *         More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/ClipperBase/Methods/Clear.htm
 *         """
 *         self.thisptr.Clear()             # <<<<<<<<<<<<<<
 * 
 *     def GetBounds(self):
 */
  __pyx_v_self->thisptr->Clear();

  /* "pyclipper.pyx":627
 *         return result
 * 
 *     def Clear(self):             # <<<<<<<<<<<<<<
 *         """ Removes all subject and clip polygons.
 *         More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/ClipperBase/Methods/Clear.htm
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":633
 *         self.thisptr.Clear()
 * 
 *     def GetBounds(self):             # <<<<<<<<<<<<<<
 *         """ Returns an axis-aligned bounding rectangle that bounds all added polygons.
 *         More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/ClipperBase/Methods/GetBounds.htm
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pyclipper_9Pyclipper_11GetBounds(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pyclipper_9Pyclipper_10GetBounds[] = " Returns an axis-aligned bounding rectangle that bounds all added polygons.\n        More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/ClipperBase/Methods/GetBounds.htm\n\n        Returns:\n        PyIntRect with left, right, bottom, top vertices that define the axis-aligned bounding rectangle.\n        ";
static PyObject *__pyx_pw_9pyclipper_9Pyclipper_11GetBounds(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("GetBounds (wrapper)", 0);
  __pyx_r = __pyx_pf_9pyclipper_9Pyclipper_10GetBounds(((struct __pyx_obj_9pyclipper_Pyclipper *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pyclipper_9Pyclipper_10GetBounds(struct __pyx_obj_9pyclipper_Pyclipper *__pyx_v_self) {
  struct ClipperLib::IntRect __pyx_v_rr;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("GetBounds", 0);

  /* "pyclipper.pyx":640
 *         PyIntRect with left, right, bottom, top vertices that define the axis-aligned bounding rectangle.
 *         """
 *         _check_scaling_factor()             # <<<<<<<<<<<<<<
 * 
 *         cdef IntRect rr = <IntRect> self.thisptr.GetBounds()
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_scaling_factor); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyclipper.pyx":642
 *         _check_scaling_factor()
 * 
 *         cdef IntRect rr = <IntRect> self.thisptr.GetBounds()             # <<<<<<<<<<<<<<
 *         return PyIntRect(left=rr.left, top=rr.top,
 *                          right=rr.right, bottom=rr.bottom)
 */
  __pyx_v_rr = __pyx_v_self->thisptr->GetBounds();

  /* "pyclipper.pyx":643
 * 
 *         cdef IntRect rr = <IntRect> self.thisptr.GetBounds()
 *         return PyIntRect(left=rr.left, top=rr.top,             # <<<<<<<<<<<<<<
 *                          right=rr.right, bottom=rr.bottom)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_PyIntRect); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_ClipperLib_3a__3a_cInt(__pyx_v_rr.left); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_left, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_From_ClipperLib_3a__3a_cInt(__pyx_v_rr.top); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_top, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyclipper.pyx":644
 *         cdef IntRect rr = <IntRect> self.thisptr.GetBounds()
 *         return PyIntRect(left=rr.left, top=rr.top,
 *                          right=rr.right, bottom=rr.bottom)             # <<<<<<<<<<<<<<
 * 
 *     def Execute(self, ClipType clip_type,
 */
  __pyx_t_3 = __Pyx_PyInt_From_ClipperLib_3a__3a_cInt(__pyx_v_rr.right); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_right, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_From_ClipperLib_3a__3a_cInt(__pyx_v_rr.bottom); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_bottom, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "pyclipper.pyx":643
 * 
 *         cdef IntRect rr = <IntRect> self.thisptr.GetBounds()
 *         return PyIntRect(left=rr.left, top=rr.top,             # <<<<<<<<<<<<<<
 *                          right=rr.right, bottom=rr.bottom)
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __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_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pyclipper.pyx":633
 *         self.thisptr.Clear()
 * 
 *     def GetBounds(self):             # <<<<<<<<<<<<<<
 *         """ Returns an axis-aligned bounding rectangle that bounds all added polygons.
 *         More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/ClipperBase/Methods/GetBounds.htm
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyclipper.Pyclipper.GetBounds", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":646
 *                          right=rr.right, bottom=rr.bottom)
 * 
 *     def Execute(self, ClipType clip_type,             # <<<<<<<<<<<<<<
 *                 PolyFillType subj_fill_type=pftEvenOdd, PolyFillType clip_fill_type=pftEvenOdd):
 *         """ Performs the clipping operation and returns a list of paths.
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pyclipper_9Pyclipper_13Execute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pyclipper_9Pyclipper_12Execute[] = " Performs the clipping operation and returns a list of paths.\n        More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/Clipper/Methods/Execute.htm\n\n        Keyword arguments:\n        clip_type      -- type of the clipping operation\n        subj_fill_type -- fill rule of subject paths\n        clip_fill_type -- fill rule of clip paths\n\n        Returns:\n        list of resulting paths\n\n        Raises:\n        ClipperException -- operation did not succeed\n        ";
static PyObject *__pyx_pw_9pyclipper_9Pyclipper_13Execute(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  enum ClipperLib::ClipType __pyx_v_clip_type;
  enum ClipperLib::PolyFillType __pyx_v_subj_fill_type;
  enum ClipperLib::PolyFillType __pyx_v_clip_fill_type;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Execute (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_clip_type,&__pyx_n_s_subj_fill_type,&__pyx_n_s_clip_fill_type,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_clip_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_subj_fill_type);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_clip_fill_type);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "Execute") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_clip_type = ((enum ClipperLib::ClipType)__Pyx_PyInt_As_enum__ClipperLib_3a__3a_ClipType(values[0])); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    if (values[1]) {
      __pyx_v_subj_fill_type = ((enum ClipperLib::PolyFillType)__Pyx_PyInt_As_enum__ClipperLib_3a__3a_PolyFillType(values[1])); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_subj_fill_type = __pyx_k__11;
    }
    if (values[2]) {
      __pyx_v_clip_fill_type = ((enum ClipperLib::PolyFillType)__Pyx_PyInt_As_enum__ClipperLib_3a__3a_PolyFillType(values[2])); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_clip_fill_type = __pyx_k__12;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Execute", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyclipper.Pyclipper.Execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pyclipper_9Pyclipper_12Execute(((struct __pyx_obj_9pyclipper_Pyclipper *)__pyx_v_self), __pyx_v_clip_type, __pyx_v_subj_fill_type, __pyx_v_clip_fill_type);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pyclipper_9Pyclipper_12Execute(struct __pyx_obj_9pyclipper_Pyclipper *__pyx_v_self, enum ClipperLib::ClipType __pyx_v_clip_type, enum ClipperLib::PolyFillType __pyx_v_subj_fill_type, enum ClipperLib::PolyFillType __pyx_v_clip_fill_type) {
  ClipperLib::Paths __pyx_v_solution;
  PyObject *__pyx_v_success = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Execute", 0);

  /* "pyclipper.pyx":664
 * 
 *         cdef Paths solution
 *         cdef object success = <bint> self.thisptr.Execute(clip_type, solution, subj_fill_type, clip_fill_type)             # <<<<<<<<<<<<<<
 *         if not success:
 *             raise ClipperException('Execution of clipper did not succeed!')
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->thisptr->Execute(__pyx_v_clip_type, __pyx_v_solution, __pyx_v_subj_fill_type, __pyx_v_clip_fill_type) != 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_success = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyclipper.pyx":665
 *         cdef Paths solution
 *         cdef object success = <bint> self.thisptr.Execute(clip_type, solution, subj_fill_type, clip_fill_type)
 *         if not success:             # <<<<<<<<<<<<<<
 *             raise ClipperException('Execution of clipper did not succeed!')
 *         return _from_clipper_paths(solution)
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_success); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((!__pyx_t_2) != 0);
  if (__pyx_t_3) {

    /* "pyclipper.pyx":666
 *         cdef object success = <bint> self.thisptr.Execute(clip_type, solution, subj_fill_type, clip_fill_type)
 *         if not success:
 *             raise ClipperException('Execution of clipper did not succeed!')             # <<<<<<<<<<<<<<
 *         return _from_clipper_paths(solution)
 * 
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ClipperException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pyclipper.pyx":665
 *         cdef Paths solution
 *         cdef object success = <bint> self.thisptr.Execute(clip_type, solution, subj_fill_type, clip_fill_type)
 *         if not success:             # <<<<<<<<<<<<<<
 *             raise ClipperException('Execution of clipper did not succeed!')
 *         return _from_clipper_paths(solution)
 */
  }

  /* "pyclipper.pyx":667
 *         if not success:
 *             raise ClipperException('Execution of clipper did not succeed!')
 *         return _from_clipper_paths(solution)             # <<<<<<<<<<<<<<
 * 
 *     def Execute2(self, ClipType clip_type,
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __pyx_f_9pyclipper__from_clipper_paths(__pyx_v_solution); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 667; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyclipper.pyx":646
 *                          right=rr.right, bottom=rr.bottom)
 * 
 *     def Execute(self, ClipType clip_type,             # <<<<<<<<<<<<<<
 *                 PolyFillType subj_fill_type=pftEvenOdd, PolyFillType clip_fill_type=pftEvenOdd):
 *         """ Performs the clipping operation and returns a list of paths.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyclipper.Pyclipper.Execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_success);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":669
 *         return _from_clipper_paths(solution)
 * 
 *     def Execute2(self, ClipType clip_type,             # <<<<<<<<<<<<<<
 *                  PolyFillType subj_fill_type=pftEvenOdd, PolyFillType clip_fill_type=pftEvenOdd):
 *         """ Performs the clipping operation and returns a PyPolyNode.
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pyclipper_9Pyclipper_15Execute2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pyclipper_9Pyclipper_14Execute2[] = " Performs the clipping operation and returns a PyPolyNode.\n        More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/Clipper/Methods/Execute.htm\n\n        Keyword arguments:\n        clip_type      -- type of the clipping operation\n        subj_fill_type -- fill rule of subject paths\n        clip_fill_type -- fill rule of clip paths\n\n        Returns:\n        PyPolyNode\n\n        Raises:\n        ClipperException -- operation did not succeed\n        ";
static PyObject *__pyx_pw_9pyclipper_9Pyclipper_15Execute2(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  enum ClipperLib::ClipType __pyx_v_clip_type;
  enum ClipperLib::PolyFillType __pyx_v_subj_fill_type;
  enum ClipperLib::PolyFillType __pyx_v_clip_fill_type;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Execute2 (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_clip_type,&__pyx_n_s_subj_fill_type,&__pyx_n_s_clip_fill_type,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_clip_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_subj_fill_type);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_clip_fill_type);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "Execute2") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_clip_type = ((enum ClipperLib::ClipType)__Pyx_PyInt_As_enum__ClipperLib_3a__3a_ClipType(values[0])); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    if (values[1]) {
      __pyx_v_subj_fill_type = ((enum ClipperLib::PolyFillType)__Pyx_PyInt_As_enum__ClipperLib_3a__3a_PolyFillType(values[1])); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_subj_fill_type = __pyx_k__14;
    }
    if (values[2]) {
      __pyx_v_clip_fill_type = ((enum ClipperLib::PolyFillType)__Pyx_PyInt_As_enum__ClipperLib_3a__3a_PolyFillType(values[2])); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 670; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_clip_fill_type = __pyx_k__15;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Execute2", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 669; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyclipper.Pyclipper.Execute2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pyclipper_9Pyclipper_14Execute2(((struct __pyx_obj_9pyclipper_Pyclipper *)__pyx_v_self), __pyx_v_clip_type, __pyx_v_subj_fill_type, __pyx_v_clip_fill_type);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pyclipper_9Pyclipper_14Execute2(struct __pyx_obj_9pyclipper_Pyclipper *__pyx_v_self, enum ClipperLib::ClipType __pyx_v_clip_type, enum ClipperLib::PolyFillType __pyx_v_subj_fill_type, enum ClipperLib::PolyFillType __pyx_v_clip_fill_type) {
  ClipperLib::PolyTree __pyx_v_solution;
  PyObject *__pyx_v_success = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Execute2", 0);

  /* "pyclipper.pyx":686
 *         """
 *         cdef PolyTree solution
 *         cdef object success = <bint> self.thisptr.Execute(clip_type, solution, subj_fill_type, clip_fill_type)             # <<<<<<<<<<<<<<
 *         if not success:
 *             raise ClipperException('Execution of clipper did not succeed!')
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->thisptr->Execute(__pyx_v_clip_type, __pyx_v_solution, __pyx_v_subj_fill_type, __pyx_v_clip_fill_type) != 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_success = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyclipper.pyx":687
 *         cdef PolyTree solution
 *         cdef object success = <bint> self.thisptr.Execute(clip_type, solution, subj_fill_type, clip_fill_type)
 *         if not success:             # <<<<<<<<<<<<<<
 *             raise ClipperException('Execution of clipper did not succeed!')
 *         return _from_poly_tree(solution)
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_success); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_3 = ((!__pyx_t_2) != 0);
  if (__pyx_t_3) {

    /* "pyclipper.pyx":688
 *         cdef object success = <bint> self.thisptr.Execute(clip_type, solution, subj_fill_type, clip_fill_type)
 *         if not success:
 *             raise ClipperException('Execution of clipper did not succeed!')             # <<<<<<<<<<<<<<
 *         return _from_poly_tree(solution)
 * 
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ClipperException); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

    /* "pyclipper.pyx":687
 *         cdef PolyTree solution
 *         cdef object success = <bint> self.thisptr.Execute(clip_type, solution, subj_fill_type, clip_fill_type)
 *         if not success:             # <<<<<<<<<<<<<<
 *             raise ClipperException('Execution of clipper did not succeed!')
 *         return _from_poly_tree(solution)
 */
  }

  /* "pyclipper.pyx":689
 *         if not success:
 *             raise ClipperException('Execution of clipper did not succeed!')
 *         return _from_poly_tree(solution)             # <<<<<<<<<<<<<<
 * 
 *     property ReverseSolution:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __pyx_f_9pyclipper__from_poly_tree(__pyx_v_solution); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pyclipper.pyx":669
 *         return _from_clipper_paths(solution)
 * 
 *     def Execute2(self, ClipType clip_type,             # <<<<<<<<<<<<<<
 *                  PolyFillType subj_fill_type=pftEvenOdd, PolyFillType clip_fill_type=pftEvenOdd):
 *         """ Performs the clipping operation and returns a PyPolyNode.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pyclipper.Pyclipper.Execute2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_success);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":696
 *         More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/Clipper/Properties/ReverseSolution.htm
 *         """
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return <bint> self.thisptr.ReverseSolution()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pyclipper_9Pyclipper_15ReverseSolution_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pyclipper_9Pyclipper_15ReverseSolution_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pyclipper_9Pyclipper_15ReverseSolution___get__(((struct __pyx_obj_9pyclipper_Pyclipper *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pyclipper_9Pyclipper_15ReverseSolution___get__(struct __pyx_obj_9pyclipper_Pyclipper *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyclipper.pyx":697
 *         """
 *         def __get__(self):
 *             return <bint> self.thisptr.ReverseSolution()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->thisptr->ReverseSolution() != 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyclipper.pyx":696
 *         More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/Clipper/Properties/ReverseSolution.htm
 *         """
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return <bint> self.thisptr.ReverseSolution()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyclipper.Pyclipper.ReverseSolution.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":699
 *             return <bint> self.thisptr.ReverseSolution()
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             self.thisptr.ReverseSolution(<bint> value)
 * 
 */

/* Python wrapper */
static int __pyx_pw_9pyclipper_9Pyclipper_15ReverseSolution_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_9pyclipper_9Pyclipper_15ReverseSolution_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pyclipper_9Pyclipper_15ReverseSolution_2__set__(((struct __pyx_obj_9pyclipper_Pyclipper *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9pyclipper_9Pyclipper_15ReverseSolution_2__set__(struct __pyx_obj_9pyclipper_Pyclipper *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "pyclipper.pyx":700
 * 
 *         def __set__(self, value):
 *             self.thisptr.ReverseSolution(<bint> value)             # <<<<<<<<<<<<<<
 * 
 *     property PreserveCollinear:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->thisptr->ReverseSolution(__pyx_t_1);

  /* "pyclipper.pyx":699
 *             return <bint> self.thisptr.ReverseSolution()
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             self.thisptr.ReverseSolution(<bint> value)
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyclipper.Pyclipper.ReverseSolution.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":706
 *         More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/Clipper/Properties/PreserveCollinear.htm
 *         """
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return <bint> self.thisptr.PreserveCollinear()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pyclipper_9Pyclipper_17PreserveCollinear_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pyclipper_9Pyclipper_17PreserveCollinear_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pyclipper_9Pyclipper_17PreserveCollinear___get__(((struct __pyx_obj_9pyclipper_Pyclipper *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pyclipper_9Pyclipper_17PreserveCollinear___get__(struct __pyx_obj_9pyclipper_Pyclipper *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyclipper.pyx":707
 *         """
 *         def __get__(self):
 *             return <bint> self.thisptr.PreserveCollinear()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->thisptr->PreserveCollinear() != 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyclipper.pyx":706
 *         More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/Clipper/Properties/PreserveCollinear.htm
 *         """
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return <bint> self.thisptr.PreserveCollinear()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyclipper.Pyclipper.PreserveCollinear.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":709
 *             return <bint> self.thisptr.PreserveCollinear()
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             self.thisptr.PreserveCollinear(<bint> value)
 * 
 */

/* Python wrapper */
static int __pyx_pw_9pyclipper_9Pyclipper_17PreserveCollinear_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_9pyclipper_9Pyclipper_17PreserveCollinear_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pyclipper_9Pyclipper_17PreserveCollinear_2__set__(((struct __pyx_obj_9pyclipper_Pyclipper *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9pyclipper_9Pyclipper_17PreserveCollinear_2__set__(struct __pyx_obj_9pyclipper_Pyclipper *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "pyclipper.pyx":710
 * 
 *         def __set__(self, value):
 *             self.thisptr.PreserveCollinear(<bint> value)             # <<<<<<<<<<<<<<
 * 
 *     property StrictlySimple:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->thisptr->PreserveCollinear(__pyx_t_1);

  /* "pyclipper.pyx":709
 *             return <bint> self.thisptr.PreserveCollinear()
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             self.thisptr.PreserveCollinear(<bint> value)
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyclipper.Pyclipper.PreserveCollinear.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":716
 *         More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/Clipper/Properties/StrictlySimple.htm
 *         """
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return <bint> self.thisptr.StrictlySimple()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pyclipper_9Pyclipper_14StrictlySimple_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pyclipper_9Pyclipper_14StrictlySimple_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pyclipper_9Pyclipper_14StrictlySimple___get__(((struct __pyx_obj_9pyclipper_Pyclipper *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pyclipper_9Pyclipper_14StrictlySimple___get__(struct __pyx_obj_9pyclipper_Pyclipper *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyclipper.pyx":717
 *         """
 *         def __get__(self):
 *             return <bint> self.thisptr.StrictlySimple()             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_self->thisptr->StrictlySimple() != 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyclipper.pyx":716
 *         More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/Clipper/Properties/StrictlySimple.htm
 *         """
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return <bint> self.thisptr.StrictlySimple()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyclipper.Pyclipper.StrictlySimple.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":719
 *             return <bint> self.thisptr.StrictlySimple()
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             self.thisptr.StrictlySimple(<bint> value)
 * 
 */

/* Python wrapper */
static int __pyx_pw_9pyclipper_9Pyclipper_14StrictlySimple_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_9pyclipper_9Pyclipper_14StrictlySimple_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pyclipper_9Pyclipper_14StrictlySimple_2__set__(((struct __pyx_obj_9pyclipper_Pyclipper *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9pyclipper_9Pyclipper_14StrictlySimple_2__set__(struct __pyx_obj_9pyclipper_Pyclipper *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "pyclipper.pyx":720
 * 
 *         def __set__(self, value):
 *             self.thisptr.StrictlySimple(<bint> value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->thisptr->StrictlySimple(__pyx_t_1);

  /* "pyclipper.pyx":719
 *             return <bint> self.thisptr.StrictlySimple()
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             self.thisptr.StrictlySimple(<bint> value)
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyclipper.Pyclipper.StrictlySimple.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":730
 *     cdef ClipperOffset *thisptr
 * 
 *     def __cinit__(self, double miter_limit=2.0, double arc_tolerance=0.25):             # <<<<<<<<<<<<<<
 *         """ Creates an instance of the ClipperOffset class.
 * 
 */

/* Python wrapper */
static int __pyx_pw_9pyclipper_15PyclipperOffset_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9pyclipper_15PyclipperOffset_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_miter_limit;
  double __pyx_v_arc_tolerance;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_miter_limit,&__pyx_n_s_arc_tolerance,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_miter_limit);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arc_tolerance);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_miter_limit = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_miter_limit == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_miter_limit = ((double)2.0);
    }
    if (values[1]) {
      __pyx_v_arc_tolerance = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_arc_tolerance == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_arc_tolerance = ((double)0.25);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyclipper.PyclipperOffset.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pyclipper_15PyclipperOffset___cinit__(((struct __pyx_obj_9pyclipper_PyclipperOffset *)__pyx_v_self), __pyx_v_miter_limit, __pyx_v_arc_tolerance);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9pyclipper_15PyclipperOffset___cinit__(struct __pyx_obj_9pyclipper_PyclipperOffset *__pyx_v_self, double __pyx_v_miter_limit, double __pyx_v_arc_tolerance) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "pyclipper.pyx":735
 *         More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Methods/Constructor.htm
 *         """
 *         log_action("Creating an ClipperOffset instance")             # <<<<<<<<<<<<<<
 *         self.thisptr = new ClipperOffset()
 *         self.MiterLimit = miter_limit
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_log_action); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyclipper.pyx":736
 *         """
 *         log_action("Creating an ClipperOffset instance")
 *         self.thisptr = new ClipperOffset()             # <<<<<<<<<<<<<<
 *         self.MiterLimit = miter_limit
 *         self.ArcTolerance = arc_tolerance
 */
  __pyx_v_self->thisptr = new ClipperLib::ClipperOffset(NULL);

  /* "pyclipper.pyx":737
 *         log_action("Creating an ClipperOffset instance")
 *         self.thisptr = new ClipperOffset()
 *         self.MiterLimit = miter_limit             # <<<<<<<<<<<<<<
 *         self.ArcTolerance = arc_tolerance
 * 
 */
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_miter_limit); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_MiterLimit, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyclipper.pyx":738
 *         self.thisptr = new ClipperOffset()
 *         self.MiterLimit = miter_limit
 *         self.ArcTolerance = arc_tolerance             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_arc_tolerance); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ArcTolerance, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyclipper.pyx":730
 *     cdef ClipperOffset *thisptr
 * 
 *     def __cinit__(self, double miter_limit=2.0, double arc_tolerance=0.25):             # <<<<<<<<<<<<<<
 *         """ Creates an instance of the ClipperOffset class.
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pyclipper.PyclipperOffset.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":740
 *         self.ArcTolerance = arc_tolerance
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         log_action("Deleting the ClipperOffset instance")
 *         del self.thisptr
 */

/* Python wrapper */
static void __pyx_pw_9pyclipper_15PyclipperOffset_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_9pyclipper_15PyclipperOffset_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_9pyclipper_15PyclipperOffset_2__dealloc__(((struct __pyx_obj_9pyclipper_PyclipperOffset *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_9pyclipper_15PyclipperOffset_2__dealloc__(struct __pyx_obj_9pyclipper_PyclipperOffset *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "pyclipper.pyx":741
 * 
 *     def __dealloc__(self):
 *         log_action("Deleting the ClipperOffset instance")             # <<<<<<<<<<<<<<
 *         del self.thisptr
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_log_action); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyclipper.pyx":742
 *     def __dealloc__(self):
 *         log_action("Deleting the ClipperOffset instance")
 *         del self.thisptr             # <<<<<<<<<<<<<<
 * 
 *     def AddPath(self, path, JoinType join_type, EndType end_type):
 */
  delete __pyx_v_self->thisptr;

  /* "pyclipper.pyx":740
 *         self.ArcTolerance = arc_tolerance
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         log_action("Deleting the ClipperOffset instance")
 *         del self.thisptr
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("pyclipper.PyclipperOffset.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pyclipper.pyx":744
 *         del self.thisptr
 * 
 *     def AddPath(self, path, JoinType join_type, EndType end_type):             # <<<<<<<<<<<<<<
 *         """ Add individual path.
 *         More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Methods/AddPath.htm
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pyclipper_15PyclipperOffset_5AddPath(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pyclipper_15PyclipperOffset_4AddPath[] = " Add individual path.\n        More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Methods/AddPath.htm\n\n        Keyword arguments:\n        path      -- path to be added\n        join_type -- join type of added path\n        end_type  -- end type of added path\n        ";
static PyObject *__pyx_pw_9pyclipper_15PyclipperOffset_5AddPath(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_path = 0;
  enum ClipperLib::JoinType __pyx_v_join_type;
  enum ClipperLib::EndType __pyx_v_end_type;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("AddPath (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_join_type,&__pyx_n_s_end_type,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_join_type)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("AddPath", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_end_type)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("AddPath", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "AddPath") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_path = values[0];
    __pyx_v_join_type = ((enum ClipperLib::JoinType)__Pyx_PyInt_As_enum__ClipperLib_3a__3a_JoinType(values[1])); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_end_type = ((enum ClipperLib::EndType)__Pyx_PyInt_As_enum__ClipperLib_3a__3a_EndType(values[2])); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("AddPath", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyclipper.PyclipperOffset.AddPath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pyclipper_15PyclipperOffset_4AddPath(((struct __pyx_obj_9pyclipper_PyclipperOffset *)__pyx_v_self), __pyx_v_path, __pyx_v_join_type, __pyx_v_end_type);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pyclipper_15PyclipperOffset_4AddPath(struct __pyx_obj_9pyclipper_PyclipperOffset *__pyx_v_self, PyObject *__pyx_v_path, enum ClipperLib::JoinType __pyx_v_join_type, enum ClipperLib::EndType __pyx_v_end_type) {
  ClipperLib::Path __pyx_v_c_path;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("AddPath", 0);

  /* "pyclipper.pyx":753
 *         end_type  -- end type of added path
 *         """
 *         cdef Path c_path = _to_clipper_path(path)             # <<<<<<<<<<<<<<
 *         self.thisptr.AddPath(c_path, join_type, end_type)
 * 
 */
  __pyx_v_c_path = __pyx_f_9pyclipper__to_clipper_path(__pyx_v_path);

  /* "pyclipper.pyx":754
 *         """
 *         cdef Path c_path = _to_clipper_path(path)
 *         self.thisptr.AddPath(c_path, join_type, end_type)             # <<<<<<<<<<<<<<
 * 
 *     def AddPaths(self, paths, JoinType join_type, EndType end_type):
 */
  __pyx_v_self->thisptr->AddPath(__pyx_v_c_path, __pyx_v_join_type, __pyx_v_end_type);

  /* "pyclipper.pyx":744
 *         del self.thisptr
 * 
 *     def AddPath(self, path, JoinType join_type, EndType end_type):             # <<<<<<<<<<<<<<
 *         """ Add individual path.
 *         More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Methods/AddPath.htm
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":756
 *         self.thisptr.AddPath(c_path, join_type, end_type)
 * 
 *     def AddPaths(self, paths, JoinType join_type, EndType end_type):             # <<<<<<<<<<<<<<
 *         """ Add a list of paths.
 *         More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Methods/AddPaths.htm
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pyclipper_15PyclipperOffset_7AddPaths(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_9pyclipper_15PyclipperOffset_6AddPaths[] = " Add a list of paths.\n        More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Methods/AddPaths.htm\n\n        Keyword arguments:\n        path      -- paths to be added\n        join_type -- join type of added paths\n        end_type  -- end type of added paths\n        ";
static PyObject *__pyx_pw_9pyclipper_15PyclipperOffset_7AddPaths(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_paths = 0;
  enum ClipperLib::JoinType __pyx_v_join_type;
  enum ClipperLib::EndType __pyx_v_end_type;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("AddPaths (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_paths,&__pyx_n_s_join_type,&__pyx_n_s_end_type,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_paths)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_join_type)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("AddPaths", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_end_type)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("AddPaths", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "AddPaths") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_paths = values[0];
    __pyx_v_join_type = ((enum ClipperLib::JoinType)__Pyx_PyInt_As_enum__ClipperLib_3a__3a_JoinType(values[1])); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_end_type = ((enum ClipperLib::EndType)__Pyx_PyInt_As_enum__ClipperLib_3a__3a_EndType(values[2])); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("AddPaths", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyclipper.PyclipperOffset.AddPaths", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pyclipper_15PyclipperOffset_6AddPaths(((struct __pyx_obj_9pyclipper_PyclipperOffset *)__pyx_v_self), __pyx_v_paths, __pyx_v_join_type, __pyx_v_end_type);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pyclipper_15PyclipperOffset_6AddPaths(struct __pyx_obj_9pyclipper_PyclipperOffset *__pyx_v_self, PyObject *__pyx_v_paths, enum ClipperLib::JoinType __pyx_v_join_type, enum ClipperLib::EndType __pyx_v_end_type) {
  ClipperLib::Paths __pyx_v_c_paths;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("AddPaths", 0);

  /* "pyclipper.pyx":765
 *         end_type  -- end type of added paths
 *         """
 *         cdef Paths c_paths = _to_clipper_paths(paths)             # <<<<<<<<<<<<<<
 *         self.thisptr.AddPaths(c_paths, join_type, end_type)
 * 
 */
  __pyx_v_c_paths = __pyx_f_9pyclipper__to_clipper_paths(__pyx_v_paths);

  /* "pyclipper.pyx":766
 *         """
 *         cdef Paths c_paths = _to_clipper_paths(paths)
 *         self.thisptr.AddPaths(c_paths, join_type, end_type)             # <<<<<<<<<<<<<<
 * 
 *     def Execute(self, double delta):
 */
  __pyx_v_self->thisptr->AddPaths(__pyx_v_c_paths, __pyx_v_join_type, __pyx_v_end_type);

  /* "pyclipper.pyx":756
 *         self.thisptr.AddPath(c_path, join_type, end_type)
 * 
 *     def AddPaths(self, paths, JoinType join_type, EndType end_type):             # <<<<<<<<<<<<<<
 *         """ Add a list of paths.
 *         More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Methods/AddPaths.htm
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":768
 *         self.thisptr.AddPaths(c_paths, join_type, end_type)
 * 
 *     def Execute(self, double delta):             # <<<<<<<<<<<<<<
 *         """ Performs the offset operation and returns a list of offset paths.
 *         More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Methods/Execute.htm
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pyclipper_15PyclipperOffset_9Execute(PyObject *__pyx_v_self, PyObject *__pyx_arg_delta); /*proto*/
static char __pyx_doc_9pyclipper_15PyclipperOffset_8Execute[] = " Performs the offset operation and returns a list of offset paths.\n        More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Methods/Execute.htm\n\n        Keyword arguments:\n        delta -- amount to which the supplied paths will be offset - negative delta shrinks polygons,\n                 positive delta expands them.\n\n        Returns:\n        list of offset paths\n        ";
static PyObject *__pyx_pw_9pyclipper_15PyclipperOffset_9Execute(PyObject *__pyx_v_self, PyObject *__pyx_arg_delta) {
  double __pyx_v_delta;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Execute (wrapper)", 0);
  assert(__pyx_arg_delta); {
    __pyx_v_delta = __pyx_PyFloat_AsDouble(__pyx_arg_delta); if (unlikely((__pyx_v_delta == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 768; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyclipper.PyclipperOffset.Execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pyclipper_15PyclipperOffset_8Execute(((struct __pyx_obj_9pyclipper_PyclipperOffset *)__pyx_v_self), ((double)__pyx_v_delta));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pyclipper_15PyclipperOffset_8Execute(struct __pyx_obj_9pyclipper_PyclipperOffset *__pyx_v_self, double __pyx_v_delta) {
  ClipperLib::Paths __pyx_v_c_solution;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Execute", 0);

  /* "pyclipper.pyx":780
 *         """
 *         cdef Paths c_solution
 *         self.thisptr.Execute(c_solution, delta)             # <<<<<<<<<<<<<<
 *         return _from_clipper_paths(c_solution)
 * 
 */
  __pyx_v_self->thisptr->Execute(__pyx_v_c_solution, __pyx_v_delta);

  /* "pyclipper.pyx":781
 *         cdef Paths c_solution
 *         self.thisptr.Execute(c_solution, delta)
 *         return _from_clipper_paths(c_solution)             # <<<<<<<<<<<<<<
 * 
 *     def Execute2(self, double delta):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pyclipper__from_clipper_paths(__pyx_v_c_solution); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyclipper.pyx":768
 *         self.thisptr.AddPaths(c_paths, join_type, end_type)
 * 
 *     def Execute(self, double delta):             # <<<<<<<<<<<<<<
 *         """ Performs the offset operation and returns a list of offset paths.
 *         More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Methods/Execute.htm
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyclipper.PyclipperOffset.Execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":783
 *         return _from_clipper_paths(c_solution)
 * 
 *     def Execute2(self, double delta):             # <<<<<<<<<<<<<<
 *         """ Performs the offset operation and returns a PyPolyNode with offset paths.
 *         More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Methods/Execute.htm
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pyclipper_15PyclipperOffset_11Execute2(PyObject *__pyx_v_self, PyObject *__pyx_arg_delta); /*proto*/
static char __pyx_doc_9pyclipper_15PyclipperOffset_10Execute2[] = " Performs the offset operation and returns a PyPolyNode with offset paths.\n        More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Methods/Execute.htm\n\n        Keyword arguments:\n        delta -- amount to which the supplied paths will be offset - negative delta shrinks polygons,\n                 positive delta expands them.\n\n        Returns:\n        PyPolyNode\n        ";
static PyObject *__pyx_pw_9pyclipper_15PyclipperOffset_11Execute2(PyObject *__pyx_v_self, PyObject *__pyx_arg_delta) {
  double __pyx_v_delta;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Execute2 (wrapper)", 0);
  assert(__pyx_arg_delta); {
    __pyx_v_delta = __pyx_PyFloat_AsDouble(__pyx_arg_delta); if (unlikely((__pyx_v_delta == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pyclipper.PyclipperOffset.Execute2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pyclipper_15PyclipperOffset_10Execute2(((struct __pyx_obj_9pyclipper_PyclipperOffset *)__pyx_v_self), ((double)__pyx_v_delta));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pyclipper_15PyclipperOffset_10Execute2(struct __pyx_obj_9pyclipper_PyclipperOffset *__pyx_v_self, double __pyx_v_delta) {
  ClipperLib::PolyTree __pyx_v_solution;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("Execute2", 0);

  /* "pyclipper.pyx":795
 *         """
 *         cdef PolyTree solution
 *         self.thisptr.Execute(solution, delta)             # <<<<<<<<<<<<<<
 *         return _from_poly_tree(solution)
 * 
 */
  __pyx_v_self->thisptr->Execute(__pyx_v_solution, __pyx_v_delta);

  /* "pyclipper.pyx":796
 *         cdef PolyTree solution
 *         self.thisptr.Execute(solution, delta)
 *         return _from_poly_tree(solution)             # <<<<<<<<<<<<<<
 * 
 *     def Clear(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pyclipper__from_poly_tree(__pyx_v_solution); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyclipper.pyx":783
 *         return _from_clipper_paths(c_solution)
 * 
 *     def Execute2(self, double delta):             # <<<<<<<<<<<<<<
 *         """ Performs the offset operation and returns a PyPolyNode with offset paths.
 *         More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Methods/Execute.htm
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyclipper.PyclipperOffset.Execute2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":798
 *         return _from_poly_tree(solution)
 * 
 *     def Clear(self):             # <<<<<<<<<<<<<<
 *         """ Clears all paths.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pyclipper_15PyclipperOffset_13Clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pyclipper_15PyclipperOffset_12Clear[] = " Clears all paths.\n\n        More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Methods/Clear.htm\n        ";
static PyObject *__pyx_pw_9pyclipper_15PyclipperOffset_13Clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Clear (wrapper)", 0);
  __pyx_r = __pyx_pf_9pyclipper_15PyclipperOffset_12Clear(((struct __pyx_obj_9pyclipper_PyclipperOffset *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pyclipper_15PyclipperOffset_12Clear(struct __pyx_obj_9pyclipper_PyclipperOffset *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Clear", 0);

  /* "pyclipper.pyx":803
 *         More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Methods/Clear.htm
 *         """
 *         self.thisptr.Clear()             # <<<<<<<<<<<<<<
 * 
 *     property MiterLimit:
 */
  __pyx_v_self->thisptr->Clear();

  /* "pyclipper.pyx":798
 *         return _from_poly_tree(solution)
 * 
 *     def Clear(self):             # <<<<<<<<<<<<<<
 *         """ Clears all paths.
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":811
 *         More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Properties/MiterLimit.htm
 *         """
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return <double> self.thisptr.MiterLimit
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pyclipper_15PyclipperOffset_10MiterLimit_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pyclipper_15PyclipperOffset_10MiterLimit_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pyclipper_15PyclipperOffset_10MiterLimit___get__(((struct __pyx_obj_9pyclipper_PyclipperOffset *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pyclipper_15PyclipperOffset_10MiterLimit___get__(struct __pyx_obj_9pyclipper_PyclipperOffset *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyclipper.pyx":812
 *         """
 *         def __get__(self):
 *             return <double> self.thisptr.MiterLimit             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(((double)__pyx_v_self->thisptr->MiterLimit)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyclipper.pyx":811
 *         More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Properties/MiterLimit.htm
 *         """
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return <double> self.thisptr.MiterLimit
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyclipper.PyclipperOffset.MiterLimit.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":814
 *             return <double> self.thisptr.MiterLimit
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             self.thisptr.MiterLimit = <double> value
 * 
 */

/* Python wrapper */
static int __pyx_pw_9pyclipper_15PyclipperOffset_10MiterLimit_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_9pyclipper_15PyclipperOffset_10MiterLimit_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pyclipper_15PyclipperOffset_10MiterLimit_2__set__(((struct __pyx_obj_9pyclipper_PyclipperOffset *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9pyclipper_15PyclipperOffset_10MiterLimit_2__set__(struct __pyx_obj_9pyclipper_PyclipperOffset *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "pyclipper.pyx":815
 * 
 *         def __set__(self, value):
 *             self.thisptr.MiterLimit = <double> value             # <<<<<<<<<<<<<<
 * 
 *     property ArcTolerance:
 */
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->thisptr->MiterLimit = ((double)__pyx_t_1);

  /* "pyclipper.pyx":814
 *             return <double> self.thisptr.MiterLimit
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             self.thisptr.MiterLimit = <double> value
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pyclipper.PyclipperOffset.MiterLimit.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":823
 *         More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Properties/ArcTolerance.htm
 *         """
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             _check_scaling_factor()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pyclipper_15PyclipperOffset_12ArcTolerance_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pyclipper_15PyclipperOffset_12ArcTolerance_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pyclipper_15PyclipperOffset_12ArcTolerance___get__(((struct __pyx_obj_9pyclipper_PyclipperOffset *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pyclipper_15PyclipperOffset_12ArcTolerance___get__(struct __pyx_obj_9pyclipper_PyclipperOffset *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pyclipper.pyx":824
 *         """
 *         def __get__(self):
 *             _check_scaling_factor()             # <<<<<<<<<<<<<<
 * 
 *             return self.thisptr.ArcTolerance
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_scaling_factor); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyclipper.pyx":826
 *             _check_scaling_factor()
 * 
 *             return self.thisptr.ArcTolerance             # <<<<<<<<<<<<<<
 * 
 *         def __set__(self, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->thisptr->ArcTolerance); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pyclipper.pyx":823
 *         More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Properties/ArcTolerance.htm
 *         """
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             _check_scaling_factor()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyclipper.PyclipperOffset.ArcTolerance.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":828
 *             return self.thisptr.ArcTolerance
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             _check_scaling_factor()
 * 
 */

/* Python wrapper */
static int __pyx_pw_9pyclipper_15PyclipperOffset_12ArcTolerance_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_9pyclipper_15PyclipperOffset_12ArcTolerance_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9pyclipper_15PyclipperOffset_12ArcTolerance_2__set__(((struct __pyx_obj_9pyclipper_PyclipperOffset *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9pyclipper_15PyclipperOffset_12ArcTolerance_2__set__(struct __pyx_obj_9pyclipper_PyclipperOffset *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  double __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "pyclipper.pyx":829
 * 
 *         def __set__(self, value):
 *             _check_scaling_factor()             # <<<<<<<<<<<<<<
 * 
 *             self.thisptr.ArcTolerance = value
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_scaling_factor); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyclipper.pyx":831
 *             _check_scaling_factor()
 * 
 *             self.thisptr.ArcTolerance = value             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_self->thisptr->ArcTolerance = __pyx_t_4;

  /* "pyclipper.pyx":828
 *             return self.thisptr.ArcTolerance
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<<
 *             _check_scaling_factor()
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyclipper.PyclipperOffset.ArcTolerance.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":834
 * 
 * 
 * cdef _filter_polynode(pypolynode, result, filter_func=None):             # <<<<<<<<<<<<<<
 *     if (filter_func is None or filter_func(pypolynode)) and len(pypolynode.Contour) > 0:
 *         result.append(pypolynode.Contour)
 */

static PyObject *__pyx_f_9pyclipper__filter_polynode(PyObject *__pyx_v_pypolynode, PyObject *__pyx_v_result, struct __pyx_opt_args_9pyclipper__filter_polynode *__pyx_optional_args) {
  PyObject *__pyx_v_filter_func = ((PyObject *)Py_None);
  PyObject *__pyx_v_child = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  struct __pyx_opt_args_9pyclipper__filter_polynode __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_filter_polynode", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_filter_func = __pyx_optional_args->filter_func;
    }
  }

  /* "pyclipper.pyx":835
 * 
 * cdef _filter_polynode(pypolynode, result, filter_func=None):
 *     if (filter_func is None or filter_func(pypolynode)) and len(pypolynode.Contour) > 0:             # <<<<<<<<<<<<<<
 *         result.append(pypolynode.Contour)
 * 
 */
  __pyx_t_2 = (__pyx_v_filter_func == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (!__pyx_t_3) {
  } else {
    goto __pyx_L5_next_and;
  }
  __Pyx_INCREF(__pyx_v_filter_func);
  __pyx_t_5 = __pyx_v_filter_func; __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_pypolynode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
    __Pyx_INCREF(__pyx_v_pypolynode);
    __Pyx_GIVEREF(__pyx_v_pypolynode);
    PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_pypolynode);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_L5_next_and:;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pypolynode, __pyx_n_s_Contour); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = PyObject_Length(__pyx_t_4); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_3 = ((__pyx_t_8 > 0) != 0);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "pyclipper.pyx":836
 * cdef _filter_polynode(pypolynode, result, filter_func=None):
 *     if (filter_func is None or filter_func(pypolynode)) and len(pypolynode.Contour) > 0:
 *         result.append(pypolynode.Contour)             # <<<<<<<<<<<<<<
 * 
 *     for child in pypolynode.Childs:
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pypolynode, __pyx_n_s_Contour); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9 = __Pyx_PyObject_Append(__pyx_v_result, __pyx_t_4); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyclipper.pyx":835
 * 
 * cdef _filter_polynode(pypolynode, result, filter_func=None):
 *     if (filter_func is None or filter_func(pypolynode)) and len(pypolynode.Contour) > 0:             # <<<<<<<<<<<<<<
 *         result.append(pypolynode.Contour)
 * 
 */
  }

  /* "pyclipper.pyx":838
 *         result.append(pypolynode.Contour)
 * 
 *     for child in pypolynode.Childs:             # <<<<<<<<<<<<<<
 *         _filter_polynode(child, result, filter_func)
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_pypolynode, __pyx_n_s_Childs); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0;
    __pyx_t_10 = NULL;
  } else {
    __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_10 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_10)) {
      if (likely(PyList_CheckExact(__pyx_t_5))) {
        if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_10(__pyx_t_5);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_child, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyclipper.pyx":839
 * 
 *     for child in pypolynode.Childs:
 *         _filter_polynode(child, result, filter_func)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_11.__pyx_n = 1;
    __pyx_t_11.filter_func = __pyx_v_filter_func;
    __pyx_t_4 = __pyx_f_9pyclipper__filter_polynode(__pyx_v_child, __pyx_v_result, &__pyx_t_11); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "pyclipper.pyx":838
 *         result.append(pypolynode.Contour)
 * 
 *     for child in pypolynode.Childs:             # <<<<<<<<<<<<<<
 *         _filter_polynode(child, result, filter_func)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pyclipper.pyx":834
 * 
 * 
 * cdef _filter_polynode(pypolynode, result, filter_func=None):             # <<<<<<<<<<<<<<
 *     if (filter_func is None or filter_func(pypolynode)) and len(pypolynode.Contour) > 0:
 *         result.append(pypolynode.Contour)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pyclipper._filter_polynode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_child);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":842
 * 
 * 
 * cdef _from_poly_tree(PolyTree &c_polytree):             # <<<<<<<<<<<<<<
 *     poly_tree = PyPolyNode()
 *     depths = [0]
 */

static PyObject *__pyx_f_9pyclipper__from_poly_tree(ClipperLib::PolyTree &__pyx_v_c_polytree) {
  PyObject *__pyx_v_poly_tree = NULL;
  PyObject *__pyx_v_depths = NULL;
  int __pyx_v_i;
  ClipperLib::PolyNode *__pyx_v_c_child;
  PyObject *__pyx_v_py_child = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_from_poly_tree", 0);

  /* "pyclipper.pyx":843
 * 
 * cdef _from_poly_tree(PolyTree &c_polytree):
 *     poly_tree = PyPolyNode()             # <<<<<<<<<<<<<<
 *     depths = [0]
 *     for i in xrange(c_polytree.ChildCount()):
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_PyPolyNode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_poly_tree = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyclipper.pyx":844
 * cdef _from_poly_tree(PolyTree &c_polytree):
 *     poly_tree = PyPolyNode()
 *     depths = [0]             # <<<<<<<<<<<<<<
 *     for i in xrange(c_polytree.ChildCount()):
 *         c_child = c_polytree.Childs[i]
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_0);
  __pyx_v_depths = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyclipper.pyx":845
 *     poly_tree = PyPolyNode()
 *     depths = [0]
 *     for i in xrange(c_polytree.ChildCount()):             # <<<<<<<<<<<<<<
 *         c_child = c_polytree.Childs[i]
 *         py_child = _node_walk(c_child, poly_tree)
 */
  __pyx_t_4 = __pyx_v_c_polytree.ChildCount();
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "pyclipper.pyx":846
 *     depths = [0]
 *     for i in xrange(c_polytree.ChildCount()):
 *         c_child = c_polytree.Childs[i]             # <<<<<<<<<<<<<<
 *         py_child = _node_walk(c_child, poly_tree)
 *         poly_tree.Childs.append(py_child)
 */
    __pyx_v_c_child = (__pyx_v_c_polytree.Childs[__pyx_v_i]);

    /* "pyclipper.pyx":847
 *     for i in xrange(c_polytree.ChildCount()):
 *         c_child = c_polytree.Childs[i]
 *         py_child = _node_walk(c_child, poly_tree)             # <<<<<<<<<<<<<<
 *         poly_tree.Childs.append(py_child)
 *         depths.append(py_child.depth + 1)
 */
    __pyx_t_1 = __pyx_f_9pyclipper__node_walk(__pyx_v_c_child, __pyx_v_poly_tree); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_py_child, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyclipper.pyx":848
 *         c_child = c_polytree.Childs[i]
 *         py_child = _node_walk(c_child, poly_tree)
 *         poly_tree.Childs.append(py_child)             # <<<<<<<<<<<<<<
 *         depths.append(py_child.depth + 1)
 *     poly_tree.depth = max(depths)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_poly_tree, __pyx_n_s_Childs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_v_py_child); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "pyclipper.pyx":849
 *         py_child = _node_walk(c_child, poly_tree)
 *         poly_tree.Childs.append(py_child)
 *         depths.append(py_child.depth + 1)             # <<<<<<<<<<<<<<
 *     poly_tree.depth = max(depths)
 *     return poly_tree
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_py_child, __pyx_n_s_depth); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_depths, __pyx_t_2); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "pyclipper.pyx":850
 *         poly_tree.Childs.append(py_child)
 *         depths.append(py_child.depth + 1)
 *     poly_tree.depth = max(depths)             # <<<<<<<<<<<<<<
 *     return poly_tree
 * 
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_depths);
  __Pyx_GIVEREF(__pyx_v_depths);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_depths);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_max, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_poly_tree, __pyx_n_s_depth, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyclipper.pyx":851
 *         depths.append(py_child.depth + 1)
 *     poly_tree.depth = max(depths)
 *     return poly_tree             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_poly_tree);
  __pyx_r = __pyx_v_poly_tree;
  goto __pyx_L0;

  /* "pyclipper.pyx":842
 * 
 * 
 * cdef _from_poly_tree(PolyTree &c_polytree):             # <<<<<<<<<<<<<<
 *     poly_tree = PyPolyNode()
 *     depths = [0]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyclipper._from_poly_tree", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_poly_tree);
  __Pyx_XDECREF(__pyx_v_depths);
  __Pyx_XDECREF(__pyx_v_py_child);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":854
 * 
 * 
 * cdef _node_walk(PolyNode *c_polynode, object parent):             # <<<<<<<<<<<<<<
 * 
 *     py_node = PyPolyNode()
 */

static PyObject *__pyx_f_9pyclipper__node_walk(ClipperLib::PolyNode *__pyx_v_c_polynode, PyObject *__pyx_v_parent) {
  PyObject *__pyx_v_py_node = NULL;
  PyObject *__pyx_v_ishole = 0;
  PyObject *__pyx_v_isopen = 0;
  PyObject *__pyx_v_depths = NULL;
  int __pyx_v_i;
  ClipperLib::PolyNode *__pyx_v_c_node;
  PyObject *__pyx_v_py_child = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_node_walk", 0);

  /* "pyclipper.pyx":856
 * cdef _node_walk(PolyNode *c_polynode, object parent):
 * 
 *     py_node = PyPolyNode()             # <<<<<<<<<<<<<<
 *     py_node.Parent = parent
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_PyPolyNode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_py_node = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyclipper.pyx":857
 * 
 *     py_node = PyPolyNode()
 *     py_node.Parent = parent             # <<<<<<<<<<<<<<
 * 
 *     cdef object ishole = <bint>c_polynode.IsHole()
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_py_node, __pyx_n_s_Parent, __pyx_v_parent) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyclipper.pyx":859
 *     py_node.Parent = parent
 * 
 *     cdef object ishole = <bint>c_polynode.IsHole()             # <<<<<<<<<<<<<<
 *     py_node.IsHole = ishole
 * 
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_c_polynode->IsHole() != 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_ishole = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyclipper.pyx":860
 * 
 *     cdef object ishole = <bint>c_polynode.IsHole()
 *     py_node.IsHole = ishole             # <<<<<<<<<<<<<<
 * 
 *     cdef object isopen = <bint>c_polynode.IsOpen()
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_py_node, __pyx_n_s_IsHole, __pyx_v_ishole) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyclipper.pyx":862
 *     py_node.IsHole = ishole
 * 
 *     cdef object isopen = <bint>c_polynode.IsOpen()             # <<<<<<<<<<<<<<
 *     py_node.IsOpen = isopen
 * 
 */
  __pyx_t_1 = __Pyx_PyBool_FromLong((__pyx_v_c_polynode->IsOpen() != 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_isopen = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pyclipper.pyx":863
 * 
 *     cdef object isopen = <bint>c_polynode.IsOpen()
 *     py_node.IsOpen = isopen             # <<<<<<<<<<<<<<
 * 
 *     py_node.Contour = _from_clipper_path(c_polynode.Contour)
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_py_node, __pyx_n_s_IsOpen, __pyx_v_isopen) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyclipper.pyx":865
 *     py_node.IsOpen = isopen
 * 
 *     py_node.Contour = _from_clipper_path(c_polynode.Contour)             # <<<<<<<<<<<<<<
 * 
 *     # kids
 */
  __pyx_t_1 = __pyx_f_9pyclipper__from_clipper_path(__pyx_v_c_polynode->Contour); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_py_node, __pyx_n_s_Contour, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyclipper.pyx":869
 *     # kids
 *     cdef PolyNode *cNode
 *     depths = [0]             # <<<<<<<<<<<<<<
 *     for i in range(c_polynode.ChildCount()):
 *         c_node = c_polynode.Childs[i]
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_0);
  __pyx_v_depths = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyclipper.pyx":870
 *     cdef PolyNode *cNode
 *     depths = [0]
 *     for i in range(c_polynode.ChildCount()):             # <<<<<<<<<<<<<<
 *         c_node = c_polynode.Childs[i]
 *         py_child = _node_walk(c_node, py_node)
 */
  __pyx_t_4 = __pyx_v_c_polynode->ChildCount();
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "pyclipper.pyx":871
 *     depths = [0]
 *     for i in range(c_polynode.ChildCount()):
 *         c_node = c_polynode.Childs[i]             # <<<<<<<<<<<<<<
 *         py_child = _node_walk(c_node, py_node)
 * 
 */
    __pyx_v_c_node = (__pyx_v_c_polynode->Childs[__pyx_v_i]);

    /* "pyclipper.pyx":872
 *     for i in range(c_polynode.ChildCount()):
 *         c_node = c_polynode.Childs[i]
 *         py_child = _node_walk(c_node, py_node)             # <<<<<<<<<<<<<<
 * 
 *         depths.append(py_child.depth + 1)
 */
    __pyx_t_1 = __pyx_f_9pyclipper__node_walk(__pyx_v_c_node, __pyx_v_py_node); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_py_child, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "pyclipper.pyx":874
 *         py_child = _node_walk(c_node, py_node)
 * 
 *         depths.append(py_child.depth + 1)             # <<<<<<<<<<<<<<
 *         py_node.Childs.append(py_child)
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_py_child, __pyx_n_s_depth); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_depths, __pyx_t_2); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pyclipper.pyx":875
 * 
 *         depths.append(py_child.depth + 1)
 *         py_node.Childs.append(py_child)             # <<<<<<<<<<<<<<
 * 
 *     py_node.depth = max(depths)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_py_node, __pyx_n_s_Childs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyObject_Append(__pyx_t_2, __pyx_v_py_child); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }

  /* "pyclipper.pyx":877
 *         py_node.Childs.append(py_child)
 * 
 *     py_node.depth = max(depths)             # <<<<<<<<<<<<<<
 * 
 *     return py_node
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_depths);
  __Pyx_GIVEREF(__pyx_v_depths);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_depths);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_max, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_py_node, __pyx_n_s_depth, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 877; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyclipper.pyx":879
 *     py_node.depth = max(depths)
 * 
 *     return py_node             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_py_node);
  __pyx_r = __pyx_v_py_node;
  goto __pyx_L0;

  /* "pyclipper.pyx":854
 * 
 * 
 * cdef _node_walk(PolyNode *c_polynode, object parent):             # <<<<<<<<<<<<<<
 * 
 *     py_node = PyPolyNode()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyclipper._node_walk", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_py_node);
  __Pyx_XDECREF(__pyx_v_ishole);
  __Pyx_XDECREF(__pyx_v_isopen);
  __Pyx_XDECREF(__pyx_v_depths);
  __Pyx_XDECREF(__pyx_v_py_child);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":882
 * 
 * 
 * cdef Paths _to_clipper_paths(object polygons):             # <<<<<<<<<<<<<<
 *     cdef Paths paths = Paths()
 *     for poly in polygons:
 */

static ClipperLib::Paths __pyx_f_9pyclipper__to_clipper_paths(PyObject *__pyx_v_polygons) {
  ClipperLib::Paths __pyx_v_paths;
  PyObject *__pyx_v_poly = NULL;
  ClipperLib::Paths __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_to_clipper_paths", 0);

  /* "pyclipper.pyx":883
 * 
 * cdef Paths _to_clipper_paths(object polygons):
 *     cdef Paths paths = Paths()             # <<<<<<<<<<<<<<
 *     for poly in polygons:
 *         paths.push_back(_to_clipper_path(poly))
 */
  __pyx_v_paths = ClipperLib::Paths();

  /* "pyclipper.pyx":884
 * cdef Paths _to_clipper_paths(object polygons):
 *     cdef Paths paths = Paths()
 *     for poly in polygons:             # <<<<<<<<<<<<<<
 *         paths.push_back(_to_clipper_path(poly))
 *     return paths
 */
  if (likely(PyList_CheckExact(__pyx_v_polygons)) || PyTuple_CheckExact(__pyx_v_polygons)) {
    __pyx_t_1 = __pyx_v_polygons; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_polygons); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_poly, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "pyclipper.pyx":885
 *     cdef Paths paths = Paths()
 *     for poly in polygons:
 *         paths.push_back(_to_clipper_path(poly))             # <<<<<<<<<<<<<<
 *     return paths
 * 
 */
    __pyx_v_paths.push_back(__pyx_f_9pyclipper__to_clipper_path(__pyx_v_poly));

    /* "pyclipper.pyx":884
 * cdef Paths _to_clipper_paths(object polygons):
 *     cdef Paths paths = Paths()
 *     for poly in polygons:             # <<<<<<<<<<<<<<
 *         paths.push_back(_to_clipper_path(poly))
 *     return paths
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyclipper.pyx":886
 *     for poly in polygons:
 *         paths.push_back(_to_clipper_path(poly))
 *     return paths             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_paths;
  goto __pyx_L0;

  /* "pyclipper.pyx":882
 * 
 * 
 * cdef Paths _to_clipper_paths(object polygons):             # <<<<<<<<<<<<<<
 *     cdef Paths paths = Paths()
 *     for poly in polygons:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("pyclipper._to_clipper_paths", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_poly);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":889
 * 
 * 
 * cdef Path _to_clipper_path(object polygon):             # <<<<<<<<<<<<<<
 *     _check_scaling_factor()
 * 
 */

static ClipperLib::Path __pyx_f_9pyclipper__to_clipper_path(PyObject *__pyx_v_polygon) {
  ClipperLib::Path __pyx_v_path;
  PyObject *__pyx_v_v = NULL;
  ClipperLib::Path __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_to_clipper_path", 0);

  /* "pyclipper.pyx":890
 * 
 * cdef Path _to_clipper_path(object polygon):
 *     _check_scaling_factor()             # <<<<<<<<<<<<<<
 * 
 *     cdef Path path = Path()
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_scaling_factor); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyclipper.pyx":892
 *     _check_scaling_factor()
 * 
 *     cdef Path path = Path()             # <<<<<<<<<<<<<<
 *     cdef IntPoint p
 *     for v in polygon:
 */
  __pyx_v_path = ClipperLib::Path();

  /* "pyclipper.pyx":894
 *     cdef Path path = Path()
 *     cdef IntPoint p
 *     for v in polygon:             # <<<<<<<<<<<<<<
 *         path.push_back(_to_clipper_point(v))
 *     return path
 */
  if (likely(PyList_CheckExact(__pyx_v_polygon)) || PyTuple_CheckExact(__pyx_v_polygon)) {
    __pyx_t_1 = __pyx_v_polygon; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_polygon); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "pyclipper.pyx":895
 *     cdef IntPoint p
 *     for v in polygon:
 *         path.push_back(_to_clipper_point(v))             # <<<<<<<<<<<<<<
 *     return path
 * 
 */
    __pyx_v_path.push_back(__pyx_f_9pyclipper__to_clipper_point(__pyx_v_v));

    /* "pyclipper.pyx":894
 *     cdef Path path = Path()
 *     cdef IntPoint p
 *     for v in polygon:             # <<<<<<<<<<<<<<
 *         path.push_back(_to_clipper_point(v))
 *     return path
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyclipper.pyx":896
 *     for v in polygon:
 *         path.push_back(_to_clipper_point(v))
 *     return path             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_path;
  goto __pyx_L0;

  /* "pyclipper.pyx":889
 * 
 * 
 * cdef Path _to_clipper_path(object polygon):             # <<<<<<<<<<<<<<
 *     _check_scaling_factor()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("pyclipper._to_clipper_path", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":899
 * 
 * 
 * cdef IntPoint _to_clipper_point(object py_point):             # <<<<<<<<<<<<<<
 *     return IntPoint(py_point[0], py_point[1])
 * 
 */

static struct ClipperLib::IntPoint __pyx_f_9pyclipper__to_clipper_point(PyObject *__pyx_v_py_point) {
  struct ClipperLib::IntPoint __pyx_r;
  __Pyx_RefNannyDeclarations
  struct ClipperLib::IntPoint __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  ClipperLib::cInt __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_to_clipper_point", 0);

  /* "pyclipper.pyx":900
 * 
 * cdef IntPoint _to_clipper_point(object py_point):
 *     return IntPoint(py_point[0], py_point[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_py_point, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_As_ClipperLib_3a__3a_cInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (ClipperLib::cInt)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1.X = __pyx_t_3;
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_py_point, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_As_ClipperLib_3a__3a_cInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (ClipperLib::cInt)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_1.Y = __pyx_t_3;
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  /* "pyclipper.pyx":899
 * 
 * 
 * cdef IntPoint _to_clipper_point(object py_point):             # <<<<<<<<<<<<<<
 *     return IntPoint(py_point[0], py_point[1])
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("pyclipper._to_clipper_point", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":903
 * 
 * 
 * cdef object _from_clipper_paths(Paths paths):             # <<<<<<<<<<<<<<
 * 
 *     polys = []
 */

static PyObject *__pyx_f_9pyclipper__from_clipper_paths(ClipperLib::Paths __pyx_v_paths) {
  PyObject *__pyx_v_polys = NULL;
  ClipperLib::Path __pyx_v_path;
  int __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_from_clipper_paths", 0);

  /* "pyclipper.pyx":905
 * cdef object _from_clipper_paths(Paths paths):
 * 
 *     polys = []             # <<<<<<<<<<<<<<
 * 
 *     cdef Path path
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_polys = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyclipper.pyx":908
 * 
 *     cdef Path path
 *     for i in xrange(paths.size()):             # <<<<<<<<<<<<<<
 *         path = paths[i]
 *         polys.append(_from_clipper_path(path))
 */
  __pyx_t_2 = __pyx_v_paths.size();
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "pyclipper.pyx":909
 *     cdef Path path
 *     for i in xrange(paths.size()):
 *         path = paths[i]             # <<<<<<<<<<<<<<
 *         polys.append(_from_clipper_path(path))
 * 
 */
    __pyx_v_path = (__pyx_v_paths[__pyx_v_i]);

    /* "pyclipper.pyx":910
 *     for i in xrange(paths.size()):
 *         path = paths[i]
 *         polys.append(_from_clipper_path(path))             # <<<<<<<<<<<<<<
 * 
 *     return polys
 */
    __pyx_t_1 = __pyx_f_9pyclipper__from_clipper_path(__pyx_v_path); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_polys, __pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "pyclipper.pyx":912
 *         polys.append(_from_clipper_path(path))
 * 
 *     return polys             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_polys);
  __pyx_r = __pyx_v_polys;
  goto __pyx_L0;

  /* "pyclipper.pyx":903
 * 
 * 
 * cdef object _from_clipper_paths(Paths paths):             # <<<<<<<<<<<<<<
 * 
 *     polys = []
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pyclipper._from_clipper_paths", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_polys);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":915
 * 
 * 
 * cdef object _from_clipper_path(Path path):             # <<<<<<<<<<<<<<
 *     _check_scaling_factor()
 * 
 */

static PyObject *__pyx_f_9pyclipper__from_clipper_path(ClipperLib::Path __pyx_v_path) {
  PyObject *__pyx_v_poly = NULL;
  struct ClipperLib::IntPoint __pyx_v_point;
  int __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_from_clipper_path", 0);

  /* "pyclipper.pyx":916
 * 
 * cdef object _from_clipper_path(Path path):
 *     _check_scaling_factor()             # <<<<<<<<<<<<<<
 * 
 *     poly = []
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_check_scaling_factor); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 916; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyclipper.pyx":918
 *     _check_scaling_factor()
 * 
 *     poly = []             # <<<<<<<<<<<<<<
 *     cdef IntPoint point
 *     for i in xrange(path.size()):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_poly = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pyclipper.pyx":920
 *     poly = []
 *     cdef IntPoint point
 *     for i in xrange(path.size()):             # <<<<<<<<<<<<<<
 *         point = path[i]
 *         poly.append([point.X, point.Y])
 */
  __pyx_t_4 = __pyx_v_path.size();
  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
    __pyx_v_i = __pyx_t_5;

    /* "pyclipper.pyx":921
 *     cdef IntPoint point
 *     for i in xrange(path.size()):
 *         point = path[i]             # <<<<<<<<<<<<<<
 *         poly.append([point.X, point.Y])
 *     return poly
 */
    __pyx_v_point = (__pyx_v_path[__pyx_v_i]);

    /* "pyclipper.pyx":922
 *     for i in xrange(path.size()):
 *         point = path[i]
 *         poly.append([point.X, point.Y])             # <<<<<<<<<<<<<<
 *     return poly
 * 
 */
    __pyx_t_1 = __Pyx_PyInt_From_ClipperLib_3a__3a_cInt(__pyx_v_point.X); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyInt_From_ClipperLib_3a__3a_cInt(__pyx_v_point.Y); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_1);
    PyList_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_poly, __pyx_t_3); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }

  /* "pyclipper.pyx":923
 *         point = path[i]
 *         poly.append([point.X, point.Y])
 *     return poly             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_poly);
  __pyx_r = __pyx_v_poly;
  goto __pyx_L0;

  /* "pyclipper.pyx":915
 * 
 * 
 * cdef object _from_clipper_path(Path path):             # <<<<<<<<<<<<<<
 *     _check_scaling_factor()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pyclipper._from_clipper_path", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_poly);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pyclipper.pyx":926
 * 
 * 
 * def _check_scaling_factor():             # <<<<<<<<<<<<<<
 *     """
 *     Check whether SCALING_FACTOR has been set by the code using this library and warn the user that it has been deprecated and it's value is ignored.
 */

/* Python wrapper */
static PyObject *__pyx_pw_9pyclipper_37_check_scaling_factor(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_9pyclipper_36_check_scaling_factor[] = "\n    Check whether SCALING_FACTOR has been set by the code using this library and warn the user that it has been deprecated and it's value is ignored.\n    ";
static PyMethodDef __pyx_mdef_9pyclipper_37_check_scaling_factor = {"_check_scaling_factor", (PyCFunction)__pyx_pw_9pyclipper_37_check_scaling_factor, METH_NOARGS, __pyx_doc_9pyclipper_36_check_scaling_factor};
static PyObject *__pyx_pw_9pyclipper_37_check_scaling_factor(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_check_scaling_factor (wrapper)", 0);
  __pyx_r = __pyx_pf_9pyclipper_36_check_scaling_factor(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pyclipper_36_check_scaling_factor(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_check_scaling_factor", 0);

  /* "pyclipper.pyx":931
 *     """
 * 
 *     if SCALING_FACTOR != 1:             # <<<<<<<<<<<<<<
 *         _warnings.warn('SCALING_FACTOR is deprecated and it\'s value is ignored. See https://github.com/greginvm/pyclipper/wiki/Deprecating-SCALING_FACTOR for more information.', DeprecationWarning)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SCALING_FACTOR); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_1, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 931; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "pyclipper.pyx":932
 * 
 *     if SCALING_FACTOR != 1:
 *         _warnings.warn('SCALING_FACTOR is deprecated and it\'s value is ignored. See https://github.com/greginvm/pyclipper/wiki/Deprecating-SCALING_FACTOR for more information.', DeprecationWarning)             # <<<<<<<<<<<<<<
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_warnings); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_warn); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
        __pyx_t_5 = 1;
      }
    }
    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_1) {
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = NULL;
    }
    __Pyx_INCREF(__pyx_kp_s_SCALING_FACTOR_is_deprecated_and);
    __Pyx_GIVEREF(__pyx_kp_s_SCALING_FACTOR_is_deprecated_and);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_kp_s_SCALING_FACTOR_is_deprecated_and);
    __Pyx_INCREF(__pyx_builtin_DeprecationWarning);
    __Pyx_GIVEREF(__pyx_builtin_DeprecationWarning);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_builtin_DeprecationWarning);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pyclipper.pyx":931
 *     """
 * 
 *     if SCALING_FACTOR != 1:             # <<<<<<<<<<<<<<
 *         _warnings.warn('SCALING_FACTOR is deprecated and it\'s value is ignored. See https://github.com/greginvm/pyclipper/wiki/Deprecating-SCALING_FACTOR for more information.', DeprecationWarning)
 */
  }

  /* "pyclipper.pyx":926
 * 
 * 
 * def _check_scaling_factor():             # <<<<<<<<<<<<<<
 *     """
 *     Check whether SCALING_FACTOR has been set by the code using this library and warn the user that it has been deprecated and it's value is ignored.
 */

  /* function exit code */
  __pyx_r = 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_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pyclipper._check_scaling_factor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_tp_new_9pyclipper_Pyclipper(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  if (unlikely(__pyx_pw_9pyclipper_9Pyclipper_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_9pyclipper_Pyclipper(PyObject *o) {
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_9pyclipper_9Pyclipper_3__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_getprop_9pyclipper_9Pyclipper_ReverseSolution(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9pyclipper_9Pyclipper_15ReverseSolution_1__get__(o);
}

static int __pyx_setprop_9pyclipper_9Pyclipper_ReverseSolution(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9pyclipper_9Pyclipper_15ReverseSolution_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_9pyclipper_9Pyclipper_PreserveCollinear(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9pyclipper_9Pyclipper_17PreserveCollinear_1__get__(o);
}

static int __pyx_setprop_9pyclipper_9Pyclipper_PreserveCollinear(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9pyclipper_9Pyclipper_17PreserveCollinear_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_9pyclipper_9Pyclipper_StrictlySimple(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9pyclipper_9Pyclipper_14StrictlySimple_1__get__(o);
}

static int __pyx_setprop_9pyclipper_9Pyclipper_StrictlySimple(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9pyclipper_9Pyclipper_14StrictlySimple_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_9pyclipper_Pyclipper[] = {
  {"AddPath", (PyCFunction)__pyx_pw_9pyclipper_9Pyclipper_5AddPath, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pyclipper_9Pyclipper_4AddPath},
  {"AddPaths", (PyCFunction)__pyx_pw_9pyclipper_9Pyclipper_7AddPaths, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pyclipper_9Pyclipper_6AddPaths},
  {"Clear", (PyCFunction)__pyx_pw_9pyclipper_9Pyclipper_9Clear, METH_NOARGS, __pyx_doc_9pyclipper_9Pyclipper_8Clear},
  {"GetBounds", (PyCFunction)__pyx_pw_9pyclipper_9Pyclipper_11GetBounds, METH_NOARGS, __pyx_doc_9pyclipper_9Pyclipper_10GetBounds},
  {"Execute", (PyCFunction)__pyx_pw_9pyclipper_9Pyclipper_13Execute, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pyclipper_9Pyclipper_12Execute},
  {"Execute2", (PyCFunction)__pyx_pw_9pyclipper_9Pyclipper_15Execute2, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pyclipper_9Pyclipper_14Execute2},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_9pyclipper_Pyclipper[] = {
  {(char *)"ReverseSolution", __pyx_getprop_9pyclipper_9Pyclipper_ReverseSolution, __pyx_setprop_9pyclipper_9Pyclipper_ReverseSolution, __pyx_k_Should_polygons_returned_from_E, 0},
  {(char *)"PreserveCollinear", __pyx_getprop_9pyclipper_9Pyclipper_PreserveCollinear, __pyx_setprop_9pyclipper_9Pyclipper_PreserveCollinear, __pyx_k_Should_clipper_preserve_colline, 0},
  {(char *)"StrictlySimple", __pyx_getprop_9pyclipper_9Pyclipper_StrictlySimple, __pyx_setprop_9pyclipper_9Pyclipper_StrictlySimple, __pyx_k_Should_polygons_returned_from_E_2, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_9pyclipper_Pyclipper = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyclipper.Pyclipper", /*tp_name*/
  sizeof(struct __pyx_obj_9pyclipper_Pyclipper), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pyclipper_Pyclipper, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "Wraps the Clipper class.\n\n    More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/Clipper/_Body.htm\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_9pyclipper_Pyclipper, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_9pyclipper_Pyclipper, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_9pyclipper_Pyclipper, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_9pyclipper_PyclipperOffset(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  if (unlikely(__pyx_pw_9pyclipper_15PyclipperOffset_1__cinit__(o, a, k) < 0)) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_9pyclipper_PyclipperOffset(PyObject *o) {
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_9pyclipper_15PyclipperOffset_3__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_getprop_9pyclipper_15PyclipperOffset_MiterLimit(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9pyclipper_15PyclipperOffset_10MiterLimit_1__get__(o);
}

static int __pyx_setprop_9pyclipper_15PyclipperOffset_MiterLimit(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9pyclipper_15PyclipperOffset_10MiterLimit_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_9pyclipper_15PyclipperOffset_ArcTolerance(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9pyclipper_15PyclipperOffset_12ArcTolerance_1__get__(o);
}

static int __pyx_setprop_9pyclipper_15PyclipperOffset_ArcTolerance(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9pyclipper_15PyclipperOffset_12ArcTolerance_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_9pyclipper_PyclipperOffset[] = {
  {"AddPath", (PyCFunction)__pyx_pw_9pyclipper_15PyclipperOffset_5AddPath, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pyclipper_15PyclipperOffset_4AddPath},
  {"AddPaths", (PyCFunction)__pyx_pw_9pyclipper_15PyclipperOffset_7AddPaths, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pyclipper_15PyclipperOffset_6AddPaths},
  {"Execute", (PyCFunction)__pyx_pw_9pyclipper_15PyclipperOffset_9Execute, METH_O, __pyx_doc_9pyclipper_15PyclipperOffset_8Execute},
  {"Execute2", (PyCFunction)__pyx_pw_9pyclipper_15PyclipperOffset_11Execute2, METH_O, __pyx_doc_9pyclipper_15PyclipperOffset_10Execute2},
  {"Clear", (PyCFunction)__pyx_pw_9pyclipper_15PyclipperOffset_13Clear, METH_NOARGS, __pyx_doc_9pyclipper_15PyclipperOffset_12Clear},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_9pyclipper_PyclipperOffset[] = {
  {(char *)"MiterLimit", __pyx_getprop_9pyclipper_15PyclipperOffset_MiterLimit, __pyx_setprop_9pyclipper_15PyclipperOffset_MiterLimit, __pyx_k_Maximum_distance_in_multiples_o, 0},
  {(char *)"ArcTolerance", __pyx_getprop_9pyclipper_15PyclipperOffset_ArcTolerance, __pyx_setprop_9pyclipper_15PyclipperOffset_ArcTolerance, __pyx_k_Maximum_acceptable_imprecision, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_9pyclipper_PyclipperOffset = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyclipper.PyclipperOffset", /*tp_name*/
  sizeof(struct __pyx_obj_9pyclipper_PyclipperOffset), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pyclipper_PyclipperOffset, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  " Wraps the ClipperOffset class.\n\n    More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/_Body.htm\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_9pyclipper_PyclipperOffset, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_9pyclipper_PyclipperOffset, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_9pyclipper_PyclipperOffset, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_9pyclipper___pyx_scope_struct__scale_to_clipper *__pyx_freelist_9pyclipper___pyx_scope_struct__scale_to_clipper[8];
static int __pyx_freecount_9pyclipper___pyx_scope_struct__scale_to_clipper = 0;

static PyObject *__pyx_tp_new_9pyclipper___pyx_scope_struct__scale_to_clipper(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_9pyclipper___pyx_scope_struct__scale_to_clipper > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_9pyclipper___pyx_scope_struct__scale_to_clipper)))) {
    o = (PyObject*)__pyx_freelist_9pyclipper___pyx_scope_struct__scale_to_clipper[--__pyx_freecount_9pyclipper___pyx_scope_struct__scale_to_clipper];
    memset(o, 0, sizeof(struct __pyx_obj_9pyclipper___pyx_scope_struct__scale_to_clipper));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_9pyclipper___pyx_scope_struct__scale_to_clipper(PyObject *o) {
  struct __pyx_obj_9pyclipper___pyx_scope_struct__scale_to_clipper *p = (struct __pyx_obj_9pyclipper___pyx_scope_struct__scale_to_clipper *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_scale);
  Py_CLEAR(p->__pyx_v_scale_value);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_9pyclipper___pyx_scope_struct__scale_to_clipper < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_9pyclipper___pyx_scope_struct__scale_to_clipper)))) {
    __pyx_freelist_9pyclipper___pyx_scope_struct__scale_to_clipper[__pyx_freecount_9pyclipper___pyx_scope_struct__scale_to_clipper++] = ((struct __pyx_obj_9pyclipper___pyx_scope_struct__scale_to_clipper *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_9pyclipper___pyx_scope_struct__scale_to_clipper(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_9pyclipper___pyx_scope_struct__scale_to_clipper *p = (struct __pyx_obj_9pyclipper___pyx_scope_struct__scale_to_clipper *)o;
  if (p->__pyx_v_scale) {
    e = (*v)(p->__pyx_v_scale, a); if (e) return e;
  }
  if (p->__pyx_v_scale_value) {
    e = (*v)(p->__pyx_v_scale_value, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_9pyclipper___pyx_scope_struct__scale_to_clipper(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_9pyclipper___pyx_scope_struct__scale_to_clipper *p = (struct __pyx_obj_9pyclipper___pyx_scope_struct__scale_to_clipper *)o;
  tmp = ((PyObject*)p->__pyx_v_scale);
  p->__pyx_v_scale = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_scale_value);
  p->__pyx_v_scale_value = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_9pyclipper___pyx_scope_struct__scale_to_clipper = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyclipper.__pyx_scope_struct__scale_to_clipper", /*tp_name*/
  sizeof(struct __pyx_obj_9pyclipper___pyx_scope_struct__scale_to_clipper), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pyclipper___pyx_scope_struct__scale_to_clipper, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_9pyclipper___pyx_scope_struct__scale_to_clipper, /*tp_traverse*/
  __pyx_tp_clear_9pyclipper___pyx_scope_struct__scale_to_clipper, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_9pyclipper___pyx_scope_struct__scale_to_clipper, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_9pyclipper___pyx_scope_struct_1_scale_from_clipper *__pyx_freelist_9pyclipper___pyx_scope_struct_1_scale_from_clipper[8];
static int __pyx_freecount_9pyclipper___pyx_scope_struct_1_scale_from_clipper = 0;

static PyObject *__pyx_tp_new_9pyclipper___pyx_scope_struct_1_scale_from_clipper(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_9pyclipper___pyx_scope_struct_1_scale_from_clipper > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_9pyclipper___pyx_scope_struct_1_scale_from_clipper)))) {
    o = (PyObject*)__pyx_freelist_9pyclipper___pyx_scope_struct_1_scale_from_clipper[--__pyx_freecount_9pyclipper___pyx_scope_struct_1_scale_from_clipper];
    memset(o, 0, sizeof(struct __pyx_obj_9pyclipper___pyx_scope_struct_1_scale_from_clipper));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_9pyclipper___pyx_scope_struct_1_scale_from_clipper(PyObject *o) {
  struct __pyx_obj_9pyclipper___pyx_scope_struct_1_scale_from_clipper *p = (struct __pyx_obj_9pyclipper___pyx_scope_struct_1_scale_from_clipper *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_scale);
  Py_CLEAR(p->__pyx_v_scale_value);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_9pyclipper___pyx_scope_struct_1_scale_from_clipper < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_9pyclipper___pyx_scope_struct_1_scale_from_clipper)))) {
    __pyx_freelist_9pyclipper___pyx_scope_struct_1_scale_from_clipper[__pyx_freecount_9pyclipper___pyx_scope_struct_1_scale_from_clipper++] = ((struct __pyx_obj_9pyclipper___pyx_scope_struct_1_scale_from_clipper *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_9pyclipper___pyx_scope_struct_1_scale_from_clipper(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_9pyclipper___pyx_scope_struct_1_scale_from_clipper *p = (struct __pyx_obj_9pyclipper___pyx_scope_struct_1_scale_from_clipper *)o;
  if (p->__pyx_v_scale) {
    e = (*v)(p->__pyx_v_scale, a); if (e) return e;
  }
  if (p->__pyx_v_scale_value) {
    e = (*v)(p->__pyx_v_scale_value, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_9pyclipper___pyx_scope_struct_1_scale_from_clipper(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_9pyclipper___pyx_scope_struct_1_scale_from_clipper *p = (struct __pyx_obj_9pyclipper___pyx_scope_struct_1_scale_from_clipper *)o;
  tmp = ((PyObject*)p->__pyx_v_scale);
  p->__pyx_v_scale = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_scale_value);
  p->__pyx_v_scale_value = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_9pyclipper___pyx_scope_struct_1_scale_from_clipper = {
  PyVarObject_HEAD_INIT(0, 0)
  "pyclipper.__pyx_scope_struct_1_scale_from_clipper", /*tp_name*/
  sizeof(struct __pyx_obj_9pyclipper___pyx_scope_struct_1_scale_from_clipper), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pyclipper___pyx_scope_struct_1_scale_from_clipper, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_9pyclipper___pyx_scope_struct_1_scale_from_clipper, /*tp_traverse*/
  __pyx_tp_clear_9pyclipper___pyx_scope_struct_1_scale_from_clipper, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_9pyclipper___pyx_scope_struct_1_scale_from_clipper, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
  #if PY_VERSION_HEX < 0x03020000
    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
  #else
    PyModuleDef_HEAD_INIT,
  #endif
    "pyclipper",
    __pyx_k_Cython_wrapper_for_the_C_transl, /* m_doc */
    -1, /* m_size */
    __pyx_methods /* m_methods */,
    NULL, /* m_reload */
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_s_All_paths_are_invalid_for_clippi, __pyx_k_All_paths_are_invalid_for_clippi, sizeof(__pyx_k_All_paths_are_invalid_for_clippi), 0, 0, 1, 0},
  {&__pyx_n_s_ArcTolerance, __pyx_k_ArcTolerance, sizeof(__pyx_k_ArcTolerance), 0, 0, 1, 1},
  {&__pyx_n_s_Area, __pyx_k_Area, sizeof(__pyx_k_Area), 0, 0, 1, 1},
  {&__pyx_n_s_CT_DIFFERENCE, __pyx_k_CT_DIFFERENCE, sizeof(__pyx_k_CT_DIFFERENCE), 0, 0, 1, 1},
  {&__pyx_n_s_CT_INTERSECTION, __pyx_k_CT_INTERSECTION, sizeof(__pyx_k_CT_INTERSECTION), 0, 0, 1, 1},
  {&__pyx_n_s_CT_UNION, __pyx_k_CT_UNION, sizeof(__pyx_k_CT_UNION), 0, 0, 1, 1},
  {&__pyx_n_s_CT_XOR, __pyx_k_CT_XOR, sizeof(__pyx_k_CT_XOR), 0, 0, 1, 1},
  {&__pyx_n_s_Childs, __pyx_k_Childs, sizeof(__pyx_k_Childs), 0, 0, 1, 1},
  {&__pyx_n_s_CleanPolygon, __pyx_k_CleanPolygon, sizeof(__pyx_k_CleanPolygon), 0, 0, 1, 1},
  {&__pyx_n_s_CleanPolygons, __pyx_k_CleanPolygons, sizeof(__pyx_k_CleanPolygons), 0, 0, 1, 1},
  {&__pyx_n_s_ClipperException, __pyx_k_ClipperException, sizeof(__pyx_k_ClipperException), 0, 0, 1, 1},
  {&__pyx_n_s_ClosedPathsFromPolyTree, __pyx_k_ClosedPathsFromPolyTree, sizeof(__pyx_k_ClosedPathsFromPolyTree), 0, 0, 1, 1},
  {&__pyx_n_s_ClosedPathsFromPolyTree_locals_l, __pyx_k_ClosedPathsFromPolyTree_locals_l, sizeof(__pyx_k_ClosedPathsFromPolyTree_locals_l), 0, 0, 1, 1},
  {&__pyx_n_s_Contour, __pyx_k_Contour, sizeof(__pyx_k_Contour), 0, 0, 1, 1},
  {&__pyx_kp_s_Creating_a_Clipper_instance, __pyx_k_Creating_a_Clipper_instance, sizeof(__pyx_k_Creating_a_Clipper_instance), 0, 0, 1, 0},
  {&__pyx_kp_s_Creating_an_ClipperOffset_instan, __pyx_k_Creating_an_ClipperOffset_instan, sizeof(__pyx_k_Creating_an_ClipperOffset_instan), 0, 0, 1, 0},
  {&__pyx_kp_s_Deleting_the_ClipperOffset_insta, __pyx_k_Deleting_the_ClipperOffset_insta, sizeof(__pyx_k_Deleting_the_ClipperOffset_insta), 0, 0, 1, 0},
  {&__pyx_kp_s_Deleting_the_Clipper_instance, __pyx_k_Deleting_the_Clipper_instance, sizeof(__pyx_k_Deleting_the_Clipper_instance), 0, 0, 1, 0},
  {&__pyx_n_s_DeprecationWarning, __pyx_k_DeprecationWarning, sizeof(__pyx_k_DeprecationWarning), 0, 0, 1, 1},
  {&__pyx_n_s_ET_CLOSEDLINE, __pyx_k_ET_CLOSEDLINE, sizeof(__pyx_k_ET_CLOSEDLINE), 0, 0, 1, 1},
  {&__pyx_n_s_ET_CLOSEDPOLYGON, __pyx_k_ET_CLOSEDPOLYGON, sizeof(__pyx_k_ET_CLOSEDPOLYGON), 0, 0, 1, 1},
  {&__pyx_n_s_ET_OPENBUTT, __pyx_k_ET_OPENBUTT, sizeof(__pyx_k_ET_OPENBUTT), 0, 0, 1, 1},
  {&__pyx_n_s_ET_OPENROUND, __pyx_k_ET_OPENROUND, sizeof(__pyx_k_ET_OPENROUND), 0, 0, 1, 1},
  {&__pyx_n_s_ET_OPENSQUARE, __pyx_k_ET_OPENSQUARE, sizeof(__pyx_k_ET_OPENSQUARE), 0, 0, 1, 1},
  {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1},
  {&__pyx_kp_s_Execution_of_clipper_did_not_suc, __pyx_k_Execution_of_clipper_did_not_suc, sizeof(__pyx_k_Execution_of_clipper_did_not_suc), 0, 0, 1, 0},
  {&__pyx_n_s_IsHole, __pyx_k_IsHole, sizeof(__pyx_k_IsHole), 0, 0, 1, 1},
  {&__pyx_n_s_IsOpen, __pyx_k_IsOpen, sizeof(__pyx_k_IsOpen), 0, 0, 1, 1},
  {&__pyx_n_s_JT_MITER, __pyx_k_JT_MITER, sizeof(__pyx_k_JT_MITER), 0, 0, 1, 1},
  {&__pyx_n_s_JT_ROUND, __pyx_k_JT_ROUND, sizeof(__pyx_k_JT_ROUND), 0, 0, 1, 1},
  {&__pyx_n_s_JT_SQUARE, __pyx_k_JT_SQUARE, sizeof(__pyx_k_JT_SQUARE), 0, 0, 1, 1},
  {&__pyx_n_s_MinkowskiDiff, __pyx_k_MinkowskiDiff, sizeof(__pyx_k_MinkowskiDiff), 0, 0, 1, 1},
  {&__pyx_n_s_MinkowskiSum, __pyx_k_MinkowskiSum, sizeof(__pyx_k_MinkowskiSum), 0, 0, 1, 1},
  {&__pyx_n_s_MinkowskiSum2, __pyx_k_MinkowskiSum2, sizeof(__pyx_k_MinkowskiSum2), 0, 0, 1, 1},
  {&__pyx_n_s_MiterLimit, __pyx_k_MiterLimit, sizeof(__pyx_k_MiterLimit), 0, 0, 1, 1},
  {&__pyx_n_s_OpenPathsFromPolyTree, __pyx_k_OpenPathsFromPolyTree, sizeof(__pyx_k_OpenPathsFromPolyTree), 0, 0, 1, 1},
  {&__pyx_n_s_OpenPathsFromPolyTree_locals_lam, __pyx_k_OpenPathsFromPolyTree_locals_lam, sizeof(__pyx_k_OpenPathsFromPolyTree_locals_lam), 0, 0, 1, 1},
  {&__pyx_n_s_Orientation, __pyx_k_Orientation, sizeof(__pyx_k_Orientation), 0, 0, 1, 1},
  {&__pyx_n_s_PFT_EVENODD, __pyx_k_PFT_EVENODD, sizeof(__pyx_k_PFT_EVENODD), 0, 0, 1, 1},
  {&__pyx_n_s_PFT_NEGATIVE, __pyx_k_PFT_NEGATIVE, sizeof(__pyx_k_PFT_NEGATIVE), 0, 0, 1, 1},
  {&__pyx_n_s_PFT_NONZERO, __pyx_k_PFT_NONZERO, sizeof(__pyx_k_PFT_NONZERO), 0, 0, 1, 1},
  {&__pyx_n_s_PFT_POSITIVE, __pyx_k_PFT_POSITIVE, sizeof(__pyx_k_PFT_POSITIVE), 0, 0, 1, 1},
  {&__pyx_n_s_PT_CLIP, __pyx_k_PT_CLIP, sizeof(__pyx_k_PT_CLIP), 0, 0, 1, 1},
  {&__pyx_n_s_PT_SUBJECT, __pyx_k_PT_SUBJECT, sizeof(__pyx_k_PT_SUBJECT), 0, 0, 1, 1},
  {&__pyx_n_s_Parent, __pyx_k_Parent, sizeof(__pyx_k_Parent), 0, 0, 1, 1},
  {&__pyx_n_s_PointInPolygon, __pyx_k_PointInPolygon, sizeof(__pyx_k_PointInPolygon), 0, 0, 1, 1},
  {&__pyx_n_s_PolyTreeToPaths, __pyx_k_PolyTreeToPaths, sizeof(__pyx_k_PolyTreeToPaths), 0, 0, 1, 1},
  {&__pyx_n_s_PyIntRect, __pyx_k_PyIntRect, sizeof(__pyx_k_PyIntRect), 0, 0, 1, 1},
  {&__pyx_n_s_PyPolyNode, __pyx_k_PyPolyNode, sizeof(__pyx_k_PyPolyNode), 0, 0, 1, 1},
  {&__pyx_n_s_PyPolyNode___init, __pyx_k_PyPolyNode___init, sizeof(__pyx_k_PyPolyNode___init), 0, 0, 1, 1},
  {&__pyx_kp_s_Python_binding_clipper_library, __pyx_k_Python_binding_clipper_library, sizeof(__pyx_k_Python_binding_clipper_library), 0, 0, 1, 0},
  {&__pyx_n_s_Real, __pyx_k_Real, sizeof(__pyx_k_Real), 0, 0, 1, 1},
  {&__pyx_kp_s_Represents_ClipperLibs_PolyTree, __pyx_k_Represents_ClipperLibs_PolyTree, sizeof(__pyx_k_Represents_ClipperLibs_PolyTree), 0, 0, 1, 0},
  {&__pyx_n_s_ReversePath, __pyx_k_ReversePath, sizeof(__pyx_k_ReversePath), 0, 0, 1, 1},
  {&__pyx_n_s_ReversePaths, __pyx_k_ReversePaths, sizeof(__pyx_k_ReversePaths), 0, 0, 1, 1},
  {&__pyx_n_s_SCALING_FACTOR, __pyx_k_SCALING_FACTOR, sizeof(__pyx_k_SCALING_FACTOR), 0, 0, 1, 1},
  {&__pyx_kp_s_SCALING_FACTOR_is_deprecated_and, __pyx_k_SCALING_FACTOR_is_deprecated_and, sizeof(__pyx_k_SCALING_FACTOR_is_deprecated_and), 0, 0, 1, 0},
  {&__pyx_n_s_SILENT, __pyx_k_SILENT, sizeof(__pyx_k_SILENT), 0, 0, 1, 1},
  {&__pyx_n_s_SimplifyPolygon, __pyx_k_SimplifyPolygon, sizeof(__pyx_k_SimplifyPolygon), 0, 0, 1, 1},
  {&__pyx_n_s_SimplifyPolygons, __pyx_k_SimplifyPolygons, sizeof(__pyx_k_SimplifyPolygons), 0, 0, 1, 1},
  {&__pyx_kp_u_Take_a_path_or_list_of_paths_wi, __pyx_k_Take_a_path_or_list_of_paths_wi, sizeof(__pyx_k_Take_a_path_or_list_of_paths_wi), 0, 1, 0, 0},
  {&__pyx_kp_s_The_path_is_invalid_for_clipping, __pyx_k_The_path_is_invalid_for_clipping, sizeof(__pyx_k_The_path_is_invalid_for_clipping), 0, 0, 1, 0},
  {&__pyx_n_s_X, __pyx_k_X, sizeof(__pyx_k_X), 0, 0, 1, 1},
  {&__pyx_n_s_Y, __pyx_k_Y, sizeof(__pyx_k_Y), 0, 0, 1, 1},
  {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
  {&__pyx_n_s_arc_tolerance, __pyx_k_arc_tolerance, sizeof(__pyx_k_arc_tolerance), 0, 0, 1, 1},
  {&__pyx_n_s_bottom, __pyx_k_bottom, sizeof(__pyx_k_bottom), 0, 0, 1, 1},
  {&__pyx_n_s_c_path, __pyx_k_c_path, sizeof(__pyx_k_c_path), 0, 0, 1, 1},
  {&__pyx_n_s_c_paths, __pyx_k_c_paths, sizeof(__pyx_k_c_paths), 0, 0, 1, 1},
  {&__pyx_n_s_check_scaling_factor, __pyx_k_check_scaling_factor, sizeof(__pyx_k_check_scaling_factor), 0, 0, 1, 1},
  {&__pyx_n_s_clip_fill_type, __pyx_k_clip_fill_type, sizeof(__pyx_k_clip_fill_type), 0, 0, 1, 1},
  {&__pyx_n_s_clip_type, __pyx_k_clip_type, sizeof(__pyx_k_clip_type), 0, 0, 1, 1},
  {&__pyx_n_s_closed, __pyx_k_closed, sizeof(__pyx_k_closed), 0, 0, 1, 1},
  {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1},
  {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
  {&__pyx_n_s_copy_2, __pyx_k_copy_2, sizeof(__pyx_k_copy_2), 0, 0, 1, 1},
  {&__pyx_n_s_depth, __pyx_k_depth, sizeof(__pyx_k_depth), 0, 0, 1, 1},
  {&__pyx_n_s_description, __pyx_k_description, sizeof(__pyx_k_description), 0, 0, 1, 1},
  {&__pyx_n_s_distance, __pyx_k_distance, sizeof(__pyx_k_distance), 0, 0, 1, 1},
  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
  {&__pyx_n_s_end_type, __pyx_k_end_type, sizeof(__pyx_k_end_type), 0, 0, 1, 1},
  {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1},
  {&__pyx_n_s_fill_type, __pyx_k_fill_type, sizeof(__pyx_k_fill_type), 0, 0, 1, 1},
  {&__pyx_kp_s_home_gregor_work_priv_pyclipper, __pyx_k_home_gregor_work_priv_pyclipper, sizeof(__pyx_k_home_gregor_work_priv_pyclipper), 0, 0, 1, 0},
  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
  {&__pyx_n_s_join_type, __pyx_k_join_type, sizeof(__pyx_k_join_type), 0, 0, 1, 1},
  {&__pyx_n_s_left, __pyx_k_left, sizeof(__pyx_k_left), 0, 0, 1, 1},
  {&__pyx_n_s_log_action, __pyx_k_log_action, sizeof(__pyx_k_log_action), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 0, 1, 1},
  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  {&__pyx_n_s_miter_limit, __pyx_k_miter_limit, sizeof(__pyx_k_miter_limit), 0, 0, 1, 1},
  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  {&__pyx_n_s_namedtuple, __pyx_k_namedtuple, sizeof(__pyx_k_namedtuple), 0, 0, 1, 1},
  {&__pyx_n_s_numbers, __pyx_k_numbers, sizeof(__pyx_k_numbers), 0, 0, 1, 1},
  {&__pyx_n_s_numbers_2, __pyx_k_numbers_2, sizeof(__pyx_k_numbers_2), 0, 0, 1, 1},
  {&__pyx_n_s_out_poly, __pyx_k_out_poly, sizeof(__pyx_k_out_poly), 0, 0, 1, 1},
  {&__pyx_n_s_out_polys, __pyx_k_out_polys, sizeof(__pyx_k_out_polys), 0, 0, 1, 1},
  {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1},
  {&__pyx_n_s_path_is_closed, __pyx_k_path_is_closed, sizeof(__pyx_k_path_is_closed), 0, 0, 1, 1},
  {&__pyx_n_s_path_or_paths, __pyx_k_path_or_paths, sizeof(__pyx_k_path_or_paths), 0, 0, 1, 1},
  {&__pyx_n_s_paths, __pyx_k_paths, sizeof(__pyx_k_paths), 0, 0, 1, 1},
  {&__pyx_n_s_pattern, __pyx_k_pattern, sizeof(__pyx_k_pattern), 0, 0, 1, 1},
  {&__pyx_n_s_point, __pyx_k_point, sizeof(__pyx_k_point), 0, 0, 1, 1},
  {&__pyx_n_s_poly, __pyx_k_poly, sizeof(__pyx_k_poly), 0, 0, 1, 1},
  {&__pyx_n_s_poly1, __pyx_k_poly1, sizeof(__pyx_k_poly1), 0, 0, 1, 1},
  {&__pyx_n_s_poly2, __pyx_k_poly2, sizeof(__pyx_k_poly2), 0, 0, 1, 1},
  {&__pyx_n_s_poly_node, __pyx_k_poly_node, sizeof(__pyx_k_poly_node), 0, 0, 1, 1},
  {&__pyx_n_s_poly_type, __pyx_k_poly_type, sizeof(__pyx_k_poly_type), 0, 0, 1, 1},
  {&__pyx_n_s_polys, __pyx_k_polys, sizeof(__pyx_k_polys), 0, 0, 1, 1},
  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
  {&__pyx_n_s_pyclipper, __pyx_k_pyclipper, sizeof(__pyx_k_pyclipper), 0, 0, 1, 1},
  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_n_s_right, __pyx_k_right, sizeof(__pyx_k_right), 0, 0, 1, 1},
  {&__pyx_n_s_scale, __pyx_k_scale, sizeof(__pyx_k_scale), 0, 0, 1, 1},
  {&__pyx_n_s_scale_from_clipper, __pyx_k_scale_from_clipper, sizeof(__pyx_k_scale_from_clipper), 0, 0, 1, 1},
  {&__pyx_n_s_scale_from_clipper_locals_scale, __pyx_k_scale_from_clipper_locals_scale, sizeof(__pyx_k_scale_from_clipper_locals_scale), 0, 0, 1, 1},
  {&__pyx_n_s_scale_to_clipper, __pyx_k_scale_to_clipper, sizeof(__pyx_k_scale_to_clipper), 0, 0, 1, 1},
  {&__pyx_kp_u_scale_to_clipper_line_516, __pyx_k_scale_to_clipper_line_516, sizeof(__pyx_k_scale_to_clipper_line_516), 0, 1, 0, 0},
  {&__pyx_n_s_scale_to_clipper_locals_scale_va, __pyx_k_scale_to_clipper_locals_scale_va, sizeof(__pyx_k_scale_to_clipper_locals_scale_va), 0, 0, 1, 1},
  {&__pyx_n_s_scale_value, __pyx_k_scale_value, sizeof(__pyx_k_scale_value), 0, 0, 1, 1},
  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
  {&__pyx_n_s_solution, __pyx_k_solution, sizeof(__pyx_k_solution), 0, 0, 1, 1},
  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
  {&__pyx_n_s_subj_fill_type, __pyx_k_subj_fill_type, sizeof(__pyx_k_subj_fill_type), 0, 0, 1, 1},
  {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
  {&__pyx_n_s_sys_2, __pyx_k_sys_2, sizeof(__pyx_k_sys_2), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1},
  {&__pyx_n_s_time_2, __pyx_k_time_2, sizeof(__pyx_k_time_2), 0, 0, 1, 1},
  {&__pyx_n_s_top, __pyx_k_top, sizeof(__pyx_k_top), 0, 0, 1, 1},
  {&__pyx_n_s_unicodedata, __pyx_k_unicodedata, sizeof(__pyx_k_unicodedata), 0, 0, 1, 1},
  {&__pyx_n_s_unicodedata_2, __pyx_k_unicodedata_2, sizeof(__pyx_k_unicodedata_2), 0, 0, 1, 1},
  {&__pyx_n_s_warn, __pyx_k_warn, sizeof(__pyx_k_warn), 0, 0, 1, 1},
  {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1},
  {&__pyx_n_s_warnings_2, __pyx_k_warnings_2, sizeof(__pyx_k_warnings_2), 0, 0, 1, 1},
  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
  {&__pyx_n_s_xrange, __pyx_k_xrange, sizeof(__pyx_k_xrange), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if PY_MAJOR_VERSION >= 3
  __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #else
  __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s_xrange); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  __pyx_builtin_max = __Pyx_GetBuiltinName(__pyx_n_s_max); if (!__pyx_builtin_max) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_DeprecationWarning = __Pyx_GetBuiltinName(__pyx_n_s_DeprecationWarning); if (!__pyx_builtin_DeprecationWarning) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 932; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "pyclipper.pyx":538
 *     """
 * 
 *     def scale_value(x):             # <<<<<<<<<<<<<<
 *         if isinstance(x, _numbers.Real):
 *             return <cInt>(<double>x * scale)
 */
  __pyx_tuple__3 = PyTuple_Pack(2, __pyx_n_s_x, __pyx_n_s_i); if (unlikely(!__pyx_tuple__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);
  __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_gregor_work_priv_pyclipper, __pyx_n_s_scale_value, 538, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyclipper.pyx":555
 *     """
 * 
 *     def scale_value(x):             # <<<<<<<<<<<<<<
 *         if isinstance(x, _numbers.Real):
 *             return <double>x / scale
 */
  __pyx_tuple__5 = PyTuple_Pack(2, __pyx_n_s_x, __pyx_n_s_i); if (unlikely(!__pyx_tuple__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);
  __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_gregor_work_priv_pyclipper, __pyx_n_s_scale_value, 555, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyclipper.pyx":578
 *         """
 * 
 *         log_action("Creating a Clipper instance")             # <<<<<<<<<<<<<<
 *         self.thisptr = new Clipper()
 * 
 */
  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_Creating_a_Clipper_instance); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__7);
  __Pyx_GIVEREF(__pyx_tuple__7);

  /* "pyclipper.pyx":582
 * 
 *     def __dealloc__(self):
 *         log_action("Deleting the Clipper instance")             # <<<<<<<<<<<<<<
 *         del self.thisptr
 * 
 */
  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_Deleting_the_Clipper_instance); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__8);
  __Pyx_GIVEREF(__pyx_tuple__8);

  /* "pyclipper.pyx":603
 *         cdef bint result = <bint> self.thisptr.AddPath(c_path, poly_type, <bint> closed)
 *         if not result:
 *             raise ClipperException('The path is invalid for clipping')             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_The_path_is_invalid_for_clipping); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__9);
  __Pyx_GIVEREF(__pyx_tuple__9);

  /* "pyclipper.pyx":624
 *         cdef bint result = <bint> self.thisptr.AddPaths(c_paths, poly_type, <bint> closed)
 *         if not result:
 *             raise ClipperException('All paths are invalid for clipping')             # <<<<<<<<<<<<<<
 *         return result
 * 
 */
  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_All_paths_are_invalid_for_clippi); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__10);
  __Pyx_GIVEREF(__pyx_tuple__10);

  /* "pyclipper.pyx":666
 *         cdef object success = <bint> self.thisptr.Execute(clip_type, solution, subj_fill_type, clip_fill_type)
 *         if not success:
 *             raise ClipperException('Execution of clipper did not succeed!')             # <<<<<<<<<<<<<<
 *         return _from_clipper_paths(solution)
 * 
 */
  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Execution_of_clipper_did_not_suc); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 666; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);

  /* "pyclipper.pyx":688
 *         cdef object success = <bint> self.thisptr.Execute(clip_type, solution, subj_fill_type, clip_fill_type)
 *         if not success:
 *             raise ClipperException('Execution of clipper did not succeed!')             # <<<<<<<<<<<<<<
 *         return _from_poly_tree(solution)
 * 
 */
  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Execution_of_clipper_did_not_suc); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);

  /* "pyclipper.pyx":735
 *         More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/ClipperOffset/Methods/Constructor.htm
 *         """
 *         log_action("Creating an ClipperOffset instance")             # <<<<<<<<<<<<<<
 *         self.thisptr = new ClipperOffset()
 *         self.MiterLimit = miter_limit
 */
  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Creating_an_ClipperOffset_instan); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__17);
  __Pyx_GIVEREF(__pyx_tuple__17);

  /* "pyclipper.pyx":741
 * 
 *     def __dealloc__(self):
 *         log_action("Deleting the ClipperOffset instance")             # <<<<<<<<<<<<<<
 *         del self.thisptr
 * 
 */
  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Deleting_the_ClipperOffset_insta); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__18);
  __Pyx_GIVEREF(__pyx_tuple__18);

  /* "pyclipper.pyx":17
 * 
 * 
 * def log_action(description):             # <<<<<<<<<<<<<<
 *     if not SILENT:
 *         print description
 */
  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_n_s_description); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__19);
  __Pyx_GIVEREF(__pyx_tuple__19);
  __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_gregor_work_priv_pyclipper, __pyx_n_s_log_action, 17, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyclipper.pyx":21
 *         print description
 * 
 * log_action("Python binding clipper library")             # <<<<<<<<<<<<<<
 * 
 * import sys as _sys
 */
  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_Python_binding_clipper_library); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__21);
  __Pyx_GIVEREF(__pyx_tuple__21);

  /* "pyclipper.pyx":248
 *     Represents ClipperLibs' PolyTree and PolyNode data structures.
 *     """
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self.Contour = []
 *         self.Childs = []
 */
  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__22);
  __Pyx_GIVEREF(__pyx_tuple__22);
  __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_gregor_work_priv_pyclipper, __pyx_n_s_init, 248, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyclipper.pyx":264
 * 
 * #============================= Namespace functions =========
 * def Orientation(poly):             # <<<<<<<<<<<<<<
 *     """ Get orientation of the supplied polygon.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/Orientation.htm
 */
  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_n_s_poly); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__24);
  __Pyx_GIVEREF(__pyx_tuple__24);
  __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_gregor_work_priv_pyclipper, __pyx_n_s_Orientation, 264, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyclipper.pyx":278
 * 
 * 
 * def Area(poly):             # <<<<<<<<<<<<<<
 *     """ Get area of the supplied polygon.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/Area.htm
 */
  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_n_s_poly); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);
  __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__26, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_gregor_work_priv_pyclipper, __pyx_n_s_Area, 278, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyclipper.pyx":293
 * 
 * 
 * def PointInPolygon(point, poly):             # <<<<<<<<<<<<<<
 *     """ Determine where does the point lie regarding the provided polygon.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/PointInPolygon.htm
 */
  __pyx_tuple__28 = PyTuple_Pack(2, __pyx_n_s_point, __pyx_n_s_poly); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__28);
  __Pyx_GIVEREF(__pyx_tuple__28);
  __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_gregor_work_priv_pyclipper, __pyx_n_s_PointInPolygon, 293, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyclipper.pyx":311
 * 
 * 
 * def SimplifyPolygon(poly, PolyFillType fill_type=pftEvenOdd):             # <<<<<<<<<<<<<<
 *     """ Removes self-intersections from the supplied polygon.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/SimplifyPolygon.htm
 */
  __pyx_tuple__30 = PyTuple_Pack(3, __pyx_n_s_poly, __pyx_n_s_fill_type, __pyx_n_s_out_polys); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__30);
  __Pyx_GIVEREF(__pyx_tuple__30);
  __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_gregor_work_priv_pyclipper, __pyx_n_s_SimplifyPolygon, 311, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyclipper.pyx":327
 * 
 * 
 * def SimplifyPolygons(polys, PolyFillType fill_type=pftEvenOdd):             # <<<<<<<<<<<<<<
 *     """ Removes self-intersections from the supplied polygons.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/SimplifyPolygons.htm
 */
  __pyx_tuple__32 = PyTuple_Pack(3, __pyx_n_s_polys, __pyx_n_s_fill_type, __pyx_n_s_out_polys); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__32);
  __Pyx_GIVEREF(__pyx_tuple__32);
  __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_gregor_work_priv_pyclipper, __pyx_n_s_SimplifyPolygons, 327, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyclipper.pyx":343
 * 
 * 
 * def CleanPolygon(poly, double distance=1.415):             # <<<<<<<<<<<<<<
 *     """ Removes unnecessary vertices from the provided polygon.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/CleanPolygon.htm
 */
  __pyx_tuple__34 = PyTuple_Pack(3, __pyx_n_s_poly, __pyx_n_s_distance, __pyx_n_s_out_poly); if (unlikely(!__pyx_tuple__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__34);
  __Pyx_GIVEREF(__pyx_tuple__34);
  __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_gregor_work_priv_pyclipper, __pyx_n_s_CleanPolygon, 343, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyclipper.pyx":359
 * 
 * 
 * def CleanPolygons(polys, double distance=1.415):             # <<<<<<<<<<<<<<
 *     """ Removes unnecessary vertices from the provided polygons.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/CleanPolygons.htm
 */
  __pyx_tuple__36 = PyTuple_Pack(3, __pyx_n_s_polys, __pyx_n_s_distance, __pyx_n_s_out_polys); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__36);
  __Pyx_GIVEREF(__pyx_tuple__36);
  __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_gregor_work_priv_pyclipper, __pyx_n_s_CleanPolygons, 359, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyclipper.pyx":375
 * 
 * 
 * def MinkowskiSum(pattern, path, bint path_is_closed):             # <<<<<<<<<<<<<<
 *     """ Performs Minkowski Addition of the pattern and path.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/MinkowskiSum.htm
 */
  __pyx_tuple__38 = PyTuple_Pack(4, __pyx_n_s_pattern, __pyx_n_s_path, __pyx_n_s_path_is_closed, __pyx_n_s_solution); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__38);
  __Pyx_GIVEREF(__pyx_tuple__38);
  __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_gregor_work_priv_pyclipper, __pyx_n_s_MinkowskiSum, 375, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyclipper.pyx":396
 * 
 * 
 * def MinkowskiSum2(pattern, paths, bint path_is_closed):             # <<<<<<<<<<<<<<
 *     """ Performs Minkowski Addition of the pattern and paths.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/MinkowskiSum.htm
 */
  __pyx_tuple__40 = PyTuple_Pack(4, __pyx_n_s_pattern, __pyx_n_s_paths, __pyx_n_s_path_is_closed, __pyx_n_s_solution); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__40);
  __Pyx_GIVEREF(__pyx_tuple__40);
  __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_gregor_work_priv_pyclipper, __pyx_n_s_MinkowskiSum2, 396, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyclipper.pyx":418
 * 
 * 
 * def MinkowskiDiff(poly1, poly2):             # <<<<<<<<<<<<<<
 *     """ Performs Minkowski Difference.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/MinkowskiDiff.htm
 */
  __pyx_tuple__42 = PyTuple_Pack(3, __pyx_n_s_poly1, __pyx_n_s_poly2, __pyx_n_s_solution); if (unlikely(!__pyx_tuple__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);
  __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_gregor_work_priv_pyclipper, __pyx_n_s_MinkowskiDiff, 418, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyclipper.pyx":434
 * 
 * 
 * def PolyTreeToPaths(poly_node):             # <<<<<<<<<<<<<<
 *     """ Converts a PyPolyNode to a list of paths.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/PolyTreeToPaths.htm
 */
  __pyx_tuple__44 = PyTuple_Pack(2, __pyx_n_s_poly_node, __pyx_n_s_paths); if (unlikely(!__pyx_tuple__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__44);
  __Pyx_GIVEREF(__pyx_tuple__44);
  __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_gregor_work_priv_pyclipper, __pyx_n_s_PolyTreeToPaths, 434, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyclipper.pyx":449
 * 
 * 
 * def ClosedPathsFromPolyTree(poly_node):             # <<<<<<<<<<<<<<
 *     """ Filters out open paths from the PyPolyNode and returns only closed paths.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/ClosedPathsFromPolyTree.htm
 */
  __pyx_tuple__46 = PyTuple_Pack(2, __pyx_n_s_poly_node, __pyx_n_s_paths); if (unlikely(!__pyx_tuple__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__46);
  __Pyx_GIVEREF(__pyx_tuple__46);
  __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_gregor_work_priv_pyclipper, __pyx_n_s_ClosedPathsFromPolyTree, 449, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyclipper.pyx":465
 * 
 * 
 * def OpenPathsFromPolyTree(poly_node):             # <<<<<<<<<<<<<<
 *     """ Filters out closed paths from the PyPolyNode and returns only open paths.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/OpenPathsFromPolyTree.htm
 */
  __pyx_tuple__48 = PyTuple_Pack(2, __pyx_n_s_poly_node, __pyx_n_s_paths); if (unlikely(!__pyx_tuple__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__48);
  __Pyx_GIVEREF(__pyx_tuple__48);
  __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_gregor_work_priv_pyclipper, __pyx_n_s_OpenPathsFromPolyTree, 465, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyclipper.pyx":480
 * 
 * 
 * def ReversePath(path):             # <<<<<<<<<<<<<<
 *     """ Reverses the vertex order (and hence orientation) in the specified path.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/ReversePath.htm
 */
  __pyx_tuple__50 = PyTuple_Pack(2, __pyx_n_s_path, __pyx_n_s_c_path); if (unlikely(!__pyx_tuple__50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__50);
  __Pyx_GIVEREF(__pyx_tuple__50);
  __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_gregor_work_priv_pyclipper, __pyx_n_s_ReversePath, 480, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyclipper.pyx":498
 * 
 * 
 * def ReversePaths(paths):             # <<<<<<<<<<<<<<
 *     """ Reverses the vertex order (and hence orientation) in each path.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/ReversePaths.htm
 */
  __pyx_tuple__52 = PyTuple_Pack(2, __pyx_n_s_paths, __pyx_n_s_c_paths); if (unlikely(!__pyx_tuple__52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__52);
  __Pyx_GIVEREF(__pyx_tuple__52);
  __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_gregor_work_priv_pyclipper, __pyx_n_s_ReversePaths, 498, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyclipper.pyx":516
 * 
 * 
 * def scale_to_clipper(path_or_paths, scale = 2 ** 31):             # <<<<<<<<<<<<<<
 *     """
 *     Take a path or list of paths with coordinates represented by floats and scale them using the specified factor. This function can be user to convert paths to a representation which is more appropriate for Clipper.
 */
  __pyx_tuple__54 = PyTuple_Pack(4, __pyx_n_s_path_or_paths, __pyx_n_s_scale, __pyx_n_s_scale_value, __pyx_n_s_scale_value); if (unlikely(!__pyx_tuple__54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__54);
  __Pyx_GIVEREF(__pyx_tuple__54);
  __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_gregor_work_priv_pyclipper, __pyx_n_s_scale_to_clipper, 516, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyclipper.pyx":547
 * 
 * 
 * def scale_from_clipper(path_or_paths, scale = 2 ** 31):             # <<<<<<<<<<<<<<
 *     """
 *     Take a path or list of paths with coordinates represented by ints and scale them back to a fractional representation. This function does the inverse of `scale_to_clipper()`.
 */
  __pyx_tuple__56 = PyTuple_Pack(4, __pyx_n_s_path_or_paths, __pyx_n_s_scale, __pyx_n_s_scale_value, __pyx_n_s_scale_value); if (unlikely(!__pyx_tuple__56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__56);
  __Pyx_GIVEREF(__pyx_tuple__56);
  __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_gregor_work_priv_pyclipper, __pyx_n_s_scale_from_clipper, 547, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyclipper.pyx":926
 * 
 * 
 * def _check_scaling_factor():             # <<<<<<<<<<<<<<
 *     """
 *     Check whether SCALING_FACTOR has been set by the code using this library and warn the user that it has been deprecated and it's value is ignored.
 */
  __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_gregor_work_priv_pyclipper, __pyx_n_s_check_scaling_factor, 926, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_2147483648 = PyInt_FromString((char *)"2147483648", 0, 0); if (unlikely(!__pyx_int_2147483648)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC initpyclipper(void); /*proto*/
PyMODINIT_FUNC initpyclipper(void)
#else
PyMODINIT_FUNC PyInit_pyclipper(void); /*proto*/
PyMODINIT_FUNC PyInit_pyclipper(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  #if CYTHON_REFNANNY
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  if (!__Pyx_RefNanny) {
      PyErr_Clear();
      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
      if (!__Pyx_RefNanny)
          Py_FatalError("failed to import 'refnanny' module");
  }
  #endif
  __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_pyclipper(void)", 0);
  if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("pyclipper", __pyx_methods, __pyx_k_Cython_wrapper_for_the_C_transl, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if CYTHON_COMPILING_IN_PYPY
  Py_INCREF(__pyx_b);
  #endif
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  if (__pyx_module_is_main_pyclipper) {
    if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!PyDict_GetItemString(modules, "pyclipper")) {
      if (unlikely(PyDict_SetItemString(modules, "pyclipper", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  if (PyType_Ready(&__pyx_type_9pyclipper_Pyclipper) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_9pyclipper_Pyclipper.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "Pyclipper", (PyObject *)&__pyx_type_9pyclipper_Pyclipper) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_9pyclipper_Pyclipper = &__pyx_type_9pyclipper_Pyclipper;
  if (PyType_Ready(&__pyx_type_9pyclipper_PyclipperOffset) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_9pyclipper_PyclipperOffset.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "PyclipperOffset", (PyObject *)&__pyx_type_9pyclipper_PyclipperOffset) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_9pyclipper_PyclipperOffset = &__pyx_type_9pyclipper_PyclipperOffset;
  if (PyType_Ready(&__pyx_type_9pyclipper___pyx_scope_struct__scale_to_clipper) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_9pyclipper___pyx_scope_struct__scale_to_clipper.tp_print = 0;
  __pyx_ptype_9pyclipper___pyx_scope_struct__scale_to_clipper = &__pyx_type_9pyclipper___pyx_scope_struct__scale_to_clipper;
  if (PyType_Ready(&__pyx_type_9pyclipper___pyx_scope_struct_1_scale_from_clipper) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_9pyclipper___pyx_scope_struct_1_scale_from_clipper.tp_print = 0;
  __pyx_ptype_9pyclipper___pyx_scope_struct_1_scale_from_clipper = &__pyx_type_9pyclipper___pyx_scope_struct_1_scale_from_clipper;
  /*--- Type import code ---*/
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif

  /* "pyclipper.pyx":9
 * """
 * 
 * SILENT = True             # <<<<<<<<<<<<<<
 * 
 * """
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SILENT, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyclipper.pyx":14
 * SCALING_FACTOR has been deprecated. See https://github.com/greginvm/pyclipper/wiki/Deprecating-SCALING_FACTOR for an explanation.
 * """
 * SCALING_FACTOR = 1             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SCALING_FACTOR, __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "pyclipper.pyx":17
 * 
 * 
 * def log_action(description):             # <<<<<<<<<<<<<<
 *     if not SILENT:
 *         print description
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pyclipper_1log_action, NULL, __pyx_n_s_pyclipper); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_log_action, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyclipper.pyx":21
 *         print description
 * 
 * log_action("Python binding clipper library")             # <<<<<<<<<<<<<<
 * 
 * import sys as _sys
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_log_action); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyclipper.pyx":23
 * log_action("Python binding clipper library")
 * 
 * import sys as _sys             # <<<<<<<<<<<<<<
 * import struct
 * import copy as _copy
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys_2, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyclipper.pyx":24
 * 
 * import sys as _sys
 * import struct             # <<<<<<<<<<<<<<
 * import copy as _copy
 * import unicodedata as _unicodedata
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_struct, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_struct, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyclipper.pyx":25
 * import sys as _sys
 * import struct
 * import copy as _copy             # <<<<<<<<<<<<<<
 * import unicodedata as _unicodedata
 * import time as _time
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_copy, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_copy_2, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyclipper.pyx":26
 * import struct
 * import copy as _copy
 * import unicodedata as _unicodedata             # <<<<<<<<<<<<<<
 * import time as _time
 * import warnings as _warnings
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_unicodedata, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_unicodedata_2, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyclipper.pyx":27
 * import copy as _copy
 * import unicodedata as _unicodedata
 * import time as _time             # <<<<<<<<<<<<<<
 * import warnings as _warnings
 * import numbers as _numbers
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_time, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_time_2, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyclipper.pyx":28
 * import unicodedata as _unicodedata
 * import time as _time
 * import warnings as _warnings             # <<<<<<<<<<<<<<
 * import numbers as _numbers
 * 
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_warnings_2, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyclipper.pyx":29
 * import time as _time
 * import warnings as _warnings
 * import numbers as _numbers             # <<<<<<<<<<<<<<
 * 
 * from cython.operator cimport dereference as deref
 */
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_numbers_2, 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_numbers, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyclipper.pyx":220
 * #============================= Enum mapping ================
 * 
 * JT_SQUARE = jtSquare             # <<<<<<<<<<<<<<
 * JT_ROUND = jtRound
 * JT_MITER = jtMiter
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum__ClipperLib_3a__3a_JoinType(ClipperLib::jtSquare); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_JT_SQUARE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyclipper.pyx":221
 * 
 * JT_SQUARE = jtSquare
 * JT_ROUND = jtRound             # <<<<<<<<<<<<<<
 * JT_MITER = jtMiter
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum__ClipperLib_3a__3a_JoinType(ClipperLib::jtRound); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_JT_ROUND, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyclipper.pyx":222
 * JT_SQUARE = jtSquare
 * JT_ROUND = jtRound
 * JT_MITER = jtMiter             # <<<<<<<<<<<<<<
 * 
 * ET_CLOSEDPOLYGON = etClosedPolygon
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum__ClipperLib_3a__3a_JoinType(ClipperLib::jtMiter); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_JT_MITER, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyclipper.pyx":224
 * JT_MITER = jtMiter
 * 
 * ET_CLOSEDPOLYGON = etClosedPolygon             # <<<<<<<<<<<<<<
 * ET_CLOSEDLINE = etClosedLine
 * ET_OPENBUTT = etOpenButt
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum__ClipperLib_3a__3a_EndType(ClipperLib::etClosedPolygon); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ET_CLOSEDPOLYGON, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyclipper.pyx":225
 * 
 * ET_CLOSEDPOLYGON = etClosedPolygon
 * ET_CLOSEDLINE = etClosedLine             # <<<<<<<<<<<<<<
 * ET_OPENBUTT = etOpenButt
 * ET_OPENSQUARE = etOpenSquare
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum__ClipperLib_3a__3a_EndType(ClipperLib::etClosedLine); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ET_CLOSEDLINE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyclipper.pyx":226
 * ET_CLOSEDPOLYGON = etClosedPolygon
 * ET_CLOSEDLINE = etClosedLine
 * ET_OPENBUTT = etOpenButt             # <<<<<<<<<<<<<<
 * ET_OPENSQUARE = etOpenSquare
 * ET_OPENROUND = etOpenRound
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum__ClipperLib_3a__3a_EndType(ClipperLib::etOpenButt); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ET_OPENBUTT, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyclipper.pyx":227
 * ET_CLOSEDLINE = etClosedLine
 * ET_OPENBUTT = etOpenButt
 * ET_OPENSQUARE = etOpenSquare             # <<<<<<<<<<<<<<
 * ET_OPENROUND = etOpenRound
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum__ClipperLib_3a__3a_EndType(ClipperLib::etOpenSquare); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ET_OPENSQUARE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyclipper.pyx":228
 * ET_OPENBUTT = etOpenButt
 * ET_OPENSQUARE = etOpenSquare
 * ET_OPENROUND = etOpenRound             # <<<<<<<<<<<<<<
 * 
 * CT_INTERSECTION = ctIntersection
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum__ClipperLib_3a__3a_EndType(ClipperLib::etOpenRound); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ET_OPENROUND, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyclipper.pyx":230
 * ET_OPENROUND = etOpenRound
 * 
 * CT_INTERSECTION = ctIntersection             # <<<<<<<<<<<<<<
 * CT_UNION = ctUnion
 * CT_DIFFERENCE = ctDifference
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum__ClipperLib_3a__3a_ClipType(ClipperLib::ctIntersection); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CT_INTERSECTION, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyclipper.pyx":231
 * 
 * CT_INTERSECTION = ctIntersection
 * CT_UNION = ctUnion             # <<<<<<<<<<<<<<
 * CT_DIFFERENCE = ctDifference
 * CT_XOR = ctXor
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum__ClipperLib_3a__3a_ClipType(ClipperLib::ctUnion); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CT_UNION, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyclipper.pyx":232
 * CT_INTERSECTION = ctIntersection
 * CT_UNION = ctUnion
 * CT_DIFFERENCE = ctDifference             # <<<<<<<<<<<<<<
 * CT_XOR = ctXor
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum__ClipperLib_3a__3a_ClipType(ClipperLib::ctDifference); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CT_DIFFERENCE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyclipper.pyx":233
 * CT_UNION = ctUnion
 * CT_DIFFERENCE = ctDifference
 * CT_XOR = ctXor             # <<<<<<<<<<<<<<
 * 
 * PT_SUBJECT = ptSubject
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum__ClipperLib_3a__3a_ClipType(ClipperLib::ctXor); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CT_XOR, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyclipper.pyx":235
 * CT_XOR = ctXor
 * 
 * PT_SUBJECT = ptSubject             # <<<<<<<<<<<<<<
 * PT_CLIP = ptClip
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum__ClipperLib_3a__3a_PolyType(ClipperLib::ptSubject); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PT_SUBJECT, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyclipper.pyx":236
 * 
 * PT_SUBJECT = ptSubject
 * PT_CLIP = ptClip             # <<<<<<<<<<<<<<
 * 
 * PFT_EVENODD = pftEvenOdd
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum__ClipperLib_3a__3a_PolyType(ClipperLib::ptClip); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PT_CLIP, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyclipper.pyx":238
 * PT_CLIP = ptClip
 * 
 * PFT_EVENODD = pftEvenOdd             # <<<<<<<<<<<<<<
 * PFT_NONZERO = pftNonZero
 * PFT_POSITIVE = pftPositive
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum__ClipperLib_3a__3a_PolyFillType(ClipperLib::pftEvenOdd); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PFT_EVENODD, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyclipper.pyx":239
 * 
 * PFT_EVENODD = pftEvenOdd
 * PFT_NONZERO = pftNonZero             # <<<<<<<<<<<<<<
 * PFT_POSITIVE = pftPositive
 * PFT_NEGATIVE = pftNegative
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum__ClipperLib_3a__3a_PolyFillType(ClipperLib::pftNonZero); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PFT_NONZERO, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyclipper.pyx":240
 * PFT_EVENODD = pftEvenOdd
 * PFT_NONZERO = pftNonZero
 * PFT_POSITIVE = pftPositive             # <<<<<<<<<<<<<<
 * PFT_NEGATIVE = pftNegative
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum__ClipperLib_3a__3a_PolyFillType(ClipperLib::pftPositive); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PFT_POSITIVE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyclipper.pyx":241
 * PFT_NONZERO = pftNonZero
 * PFT_POSITIVE = pftPositive
 * PFT_NEGATIVE = pftNegative             # <<<<<<<<<<<<<<
 * 
 * #=============================  PyPolyNode =================
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum__ClipperLib_3a__3a_PolyFillType(ClipperLib::pftNegative); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PFT_NEGATIVE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyclipper.pyx":244
 * 
 * #=============================  PyPolyNode =================
 * class PyPolyNode:             # <<<<<<<<<<<<<<
 *     """
 *     Represents ClipperLibs' PolyTree and PolyNode data structures.
 */
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_PyPolyNode, __pyx_n_s_PyPolyNode, (PyObject *) NULL, __pyx_n_s_pyclipper, __pyx_kp_s_Represents_ClipperLibs_PolyTree); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);

  /* "pyclipper.pyx":248
 *     Represents ClipperLibs' PolyTree and PolyNode data structures.
 *     """
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self.Contour = []
 *         self.Childs = []
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_9pyclipper_10PyPolyNode_1__init__, 0, __pyx_n_s_PyPolyNode___init, NULL, __pyx_n_s_pyclipper, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_init, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyclipper.pyx":244
 * 
 * #=============================  PyPolyNode =================
 * class PyPolyNode:             # <<<<<<<<<<<<<<
 *     """
 *     Represents ClipperLibs' PolyTree and PolyNode data structures.
 */
  __pyx_t_1 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_PyPolyNode, __pyx_empty_tuple, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PyPolyNode, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pyclipper.pyx":257
 * 
 * #=============================  Other objects ==============
 * from collections import namedtuple             # <<<<<<<<<<<<<<
 * PyIntRect = namedtuple('PyIntRect', ['left', 'top', 'right', 'bottom'])
 * 
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_namedtuple);
  __Pyx_GIVEREF(__pyx_n_s_namedtuple);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_namedtuple);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_collections, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_namedtuple); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_namedtuple, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyclipper.pyx":258
 * #=============================  Other objects ==============
 * from collections import namedtuple
 * PyIntRect = namedtuple('PyIntRect', ['left', 'top', 'right', 'bottom'])             # <<<<<<<<<<<<<<
 * 
 * class ClipperException(Exception):
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_namedtuple); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyList_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_n_s_left);
  __Pyx_GIVEREF(__pyx_n_s_left);
  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_left);
  __Pyx_INCREF(__pyx_n_s_top);
  __Pyx_GIVEREF(__pyx_n_s_top);
  PyList_SET_ITEM(__pyx_t_3, 1, __pyx_n_s_top);
  __Pyx_INCREF(__pyx_n_s_right);
  __Pyx_GIVEREF(__pyx_n_s_right);
  PyList_SET_ITEM(__pyx_t_3, 2, __pyx_n_s_right);
  __Pyx_INCREF(__pyx_n_s_bottom);
  __Pyx_GIVEREF(__pyx_n_s_bottom);
  PyList_SET_ITEM(__pyx_t_3, 3, __pyx_n_s_bottom);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (__pyx_t_4) {
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
  }
  __Pyx_INCREF(__pyx_n_s_PyIntRect);
  __Pyx_GIVEREF(__pyx_n_s_PyIntRect);
  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_n_s_PyIntRect);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PyIntRect, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyclipper.pyx":260
 * PyIntRect = namedtuple('PyIntRect', ['left', 'top', 'right', 'bottom'])
 * 
 * class ClipperException(Exception):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_builtin_Exception);
  __Pyx_GIVEREF(__pyx_builtin_Exception);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_builtin_Exception);
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_ClipperException, __pyx_n_s_ClipperException, (PyObject *) NULL, __pyx_n_s_pyclipper, (PyObject *) NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_ClipperException, __pyx_t_1, __pyx_t_6, NULL, 0, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ClipperException, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyclipper.pyx":264
 * 
 * #============================= Namespace functions =========
 * def Orientation(poly):             # <<<<<<<<<<<<<<
 *     """ Get orientation of the supplied polygon.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/Orientation.htm
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pyclipper_3Orientation, NULL, __pyx_n_s_pyclipper); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Orientation, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyclipper.pyx":278
 * 
 * 
 * def Area(poly):             # <<<<<<<<<<<<<<
 *     """ Get area of the supplied polygon.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/Area.htm
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pyclipper_5Area, NULL, __pyx_n_s_pyclipper); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Area, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyclipper.pyx":293
 * 
 * 
 * def PointInPolygon(point, poly):             # <<<<<<<<<<<<<<
 *     """ Determine where does the point lie regarding the provided polygon.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/PointInPolygon.htm
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pyclipper_7PointInPolygon, NULL, __pyx_n_s_pyclipper); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PointInPolygon, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyclipper.pyx":311
 * 
 * 
 * def SimplifyPolygon(poly, PolyFillType fill_type=pftEvenOdd):             # <<<<<<<<<<<<<<
 *     """ Removes self-intersections from the supplied polygon.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/SimplifyPolygon.htm
 */
  __pyx_k_ = ClipperLib::pftEvenOdd;
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pyclipper_9SimplifyPolygon, NULL, __pyx_n_s_pyclipper); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SimplifyPolygon, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyclipper.pyx":327
 * 
 * 
 * def SimplifyPolygons(polys, PolyFillType fill_type=pftEvenOdd):             # <<<<<<<<<<<<<<
 *     """ Removes self-intersections from the supplied polygons.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/SimplifyPolygons.htm
 */
  __pyx_k__2 = ClipperLib::pftEvenOdd;
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pyclipper_11SimplifyPolygons, NULL, __pyx_n_s_pyclipper); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SimplifyPolygons, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyclipper.pyx":343
 * 
 * 
 * def CleanPolygon(poly, double distance=1.415):             # <<<<<<<<<<<<<<
 *     """ Removes unnecessary vertices from the provided polygon.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/CleanPolygon.htm
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pyclipper_13CleanPolygon, NULL, __pyx_n_s_pyclipper); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CleanPolygon, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyclipper.pyx":359
 * 
 * 
 * def CleanPolygons(polys, double distance=1.415):             # <<<<<<<<<<<<<<
 *     """ Removes unnecessary vertices from the provided polygons.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/CleanPolygons.htm
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pyclipper_15CleanPolygons, NULL, __pyx_n_s_pyclipper); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CleanPolygons, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyclipper.pyx":375
 * 
 * 
 * def MinkowskiSum(pattern, path, bint path_is_closed):             # <<<<<<<<<<<<<<
 *     """ Performs Minkowski Addition of the pattern and path.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/MinkowskiSum.htm
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pyclipper_17MinkowskiSum, NULL, __pyx_n_s_pyclipper); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_MinkowskiSum, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyclipper.pyx":396
 * 
 * 
 * def MinkowskiSum2(pattern, paths, bint path_is_closed):             # <<<<<<<<<<<<<<
 *     """ Performs Minkowski Addition of the pattern and paths.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/MinkowskiSum.htm
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pyclipper_19MinkowskiSum2, NULL, __pyx_n_s_pyclipper); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_MinkowskiSum2, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyclipper.pyx":418
 * 
 * 
 * def MinkowskiDiff(poly1, poly2):             # <<<<<<<<<<<<<<
 *     """ Performs Minkowski Difference.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/MinkowskiDiff.htm
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pyclipper_21MinkowskiDiff, NULL, __pyx_n_s_pyclipper); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_MinkowskiDiff, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyclipper.pyx":434
 * 
 * 
 * def PolyTreeToPaths(poly_node):             # <<<<<<<<<<<<<<
 *     """ Converts a PyPolyNode to a list of paths.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/PolyTreeToPaths.htm
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pyclipper_23PolyTreeToPaths, NULL, __pyx_n_s_pyclipper); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PolyTreeToPaths, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyclipper.pyx":449
 * 
 * 
 * def ClosedPathsFromPolyTree(poly_node):             # <<<<<<<<<<<<<<
 *     """ Filters out open paths from the PyPolyNode and returns only closed paths.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/ClosedPathsFromPolyTree.htm
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pyclipper_25ClosedPathsFromPolyTree, NULL, __pyx_n_s_pyclipper); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ClosedPathsFromPolyTree, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyclipper.pyx":465
 * 
 * 
 * def OpenPathsFromPolyTree(poly_node):             # <<<<<<<<<<<<<<
 *     """ Filters out closed paths from the PyPolyNode and returns only open paths.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/OpenPathsFromPolyTree.htm
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pyclipper_27OpenPathsFromPolyTree, NULL, __pyx_n_s_pyclipper); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_OpenPathsFromPolyTree, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyclipper.pyx":480
 * 
 * 
 * def ReversePath(path):             # <<<<<<<<<<<<<<
 *     """ Reverses the vertex order (and hence orientation) in the specified path.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/ReversePath.htm
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pyclipper_29ReversePath, NULL, __pyx_n_s_pyclipper); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ReversePath, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyclipper.pyx":498
 * 
 * 
 * def ReversePaths(paths):             # <<<<<<<<<<<<<<
 *     """ Reverses the vertex order (and hence orientation) in each path.
 *     More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Functions/ReversePaths.htm
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pyclipper_31ReversePaths, NULL, __pyx_n_s_pyclipper); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ReversePaths, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyclipper.pyx":516
 * 
 * 
 * def scale_to_clipper(path_or_paths, scale = 2 ** 31):             # <<<<<<<<<<<<<<
 *     """
 *     Take a path or list of paths with coordinates represented by floats and scale them using the specified factor. This function can be user to convert paths to a representation which is more appropriate for Clipper.
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pyclipper_33scale_to_clipper, NULL, __pyx_n_s_pyclipper); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_scale_to_clipper, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyclipper.pyx":547
 * 
 * 
 * def scale_from_clipper(path_or_paths, scale = 2 ** 31):             # <<<<<<<<<<<<<<
 *     """
 *     Take a path or list of paths with coordinates represented by ints and scale them back to a fractional representation. This function does the inverse of `scale_to_clipper()`.
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pyclipper_35scale_from_clipper, NULL, __pyx_n_s_pyclipper); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_scale_from_clipper, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyclipper.pyx":647
 * 
 *     def Execute(self, ClipType clip_type,
 *                 PolyFillType subj_fill_type=pftEvenOdd, PolyFillType clip_fill_type=pftEvenOdd):             # <<<<<<<<<<<<<<
 *         """ Performs the clipping operation and returns a list of paths.
 *         More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/Clipper/Methods/Execute.htm
 */
  __pyx_k__11 = ClipperLib::pftEvenOdd;
  __pyx_k__12 = ClipperLib::pftEvenOdd;

  /* "pyclipper.pyx":670
 * 
 *     def Execute2(self, ClipType clip_type,
 *                  PolyFillType subj_fill_type=pftEvenOdd, PolyFillType clip_fill_type=pftEvenOdd):             # <<<<<<<<<<<<<<
 *         """ Performs the clipping operation and returns a PyPolyNode.
 *         More info: http://www.angusj.com/delphi/clipper/documentation/Docs/Units/ClipperLib/Classes/Clipper/Methods/Execute.htm
 */
  __pyx_k__14 = ClipperLib::pftEvenOdd;
  __pyx_k__15 = ClipperLib::pftEvenOdd;

  /* "pyclipper.pyx":926
 * 
 * 
 * def _check_scaling_factor():             # <<<<<<<<<<<<<<
 *     """
 *     Check whether SCALING_FACTOR has been set by the code using this library and warn the user that it has been deprecated and it's value is ignored.
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_9pyclipper_37_check_scaling_factor, NULL, __pyx_n_s_pyclipper); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_check_scaling_factor, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pyclipper.pyx":1
 * """             # <<<<<<<<<<<<<<
 * Cython wrapper for the C++ translation of the Angus Johnson's Clipper
 * library (ver. 6.2.1) (http://www.angusj.com/delphi/clipper.php)
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_kp_u_scale_to_clipper_line_516, __pyx_kp_u_Take_a_path_or_list_of_paths_wi) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /*--- Wrapped vars code ---*/

  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_6);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init pyclipper", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init pyclipper");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}

/* --- Runtime support code --- */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule((char *)modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
    if (unlikely(!result)) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
    PyObject *result;
#if CYTHON_COMPILING_IN_CPYTHON
    result = PyDict_GetItem(__pyx_d, name);
    if (likely(result)) {
        Py_INCREF(result);
    } else {
#else
    result = PyObject_GetItem(__pyx_d, name);
    if (!result) {
        PyErr_Clear();
#endif
        result = __Pyx_GetBuiltinName(name);
    }
    return result;
}

static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* fake_module;
    PyTypeObject* cached_type = NULL;
    fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
    if (!fake_module) return NULL;
    Py_INCREF(fake_module);
    cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
    if (cached_type) {
        if (!PyType_Check((PyObject*)cached_type)) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s is not a type object",
                type->tp_name);
            goto bad;
        }
        if (cached_type->tp_basicsize != type->tp_basicsize) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s has the wrong size, try recompiling",
                type->tp_name);
            goto bad;
        }
    } else {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
        PyErr_Clear();
        if (PyType_Ready(type) < 0) goto bad;
        if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
            goto bad;
        Py_INCREF(type);
        cached_type = type;
    }
done:
    Py_DECREF(fake_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
{
    if (unlikely(op->func_doc == NULL)) {
        if (op->func.m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
            op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
#else
            op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
#endif
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp = op->func_doc;
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    op->func_doc = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_name == NULL)) {
#if PY_MAJOR_VERSION >= 3
        op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
#else
        op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = op->func_name;
    Py_INCREF(value);
    op->func_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op)
{
    Py_INCREF(op->func_qualname);
    return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = op->func_qualname;
    Py_INCREF(value);
    op->func_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
{
    PyObject *self;
    self = m->func_closure;
    if (self == NULL)
        self = Py_None;
    Py_INCREF(self);
    return self;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_dict == NULL)) {
        op->func_dict = PyDict_New();
        if (unlikely(op->func_dict == NULL))
            return NULL;
    }
    Py_INCREF(op->func_dict);
    return op->func_dict;
}
static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
    if (unlikely(value == NULL)) {
        PyErr_SetString(PyExc_TypeError,
               "function's dictionary may not be deleted");
        return -1;
    }
    if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
               "setting function's dictionary to a non-dict");
        return -1;
    }
    tmp = op->func_dict;
    Py_INCREF(value);
    op->func_dict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op)
{
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op)
{
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
    int result = 0;
    PyObject *res = op->defaults_getter((PyObject *) op);
    if (unlikely(!res))
        return -1;
    #if CYTHON_COMPILING_IN_CPYTHON
    op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
    Py_INCREF(op->defaults_tuple);
    op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
    Py_INCREF(op->defaults_kwdict);
    #else
    op->defaults_tuple = PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = PySequence_ITEM(res, 1);
        if (unlikely(!op->defaults_kwdict)) result = -1;
    }
    #endif
    Py_DECREF(res);
    return result;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyTuple_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_tuple;
    op->defaults_tuple = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_tuple;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_kwdict;
    op->defaults_kwdict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_kwdict;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) {
    PyObject* tmp;
    if (!value || value == Py_None) {
        value = NULL;
    } else if (!PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    tmp = op->func_annotations;
    op->func_annotations = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) {
    PyObject* result = op->func_annotations;
    if (unlikely(!result)) {
        result = PyDict_New();
        if (unlikely(!result)) return NULL;
        op->func_annotations = result;
    }
    Py_INCREF(result);
    return result;
}
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
    {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
    {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
    {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0},
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromString(m->func.m_ml->ml_name);
#else
    return PyString_FromString(m->func.m_ml->ml_name);
#endif
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if PY_VERSION_HEX < 0x030500A0
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
    if (op == NULL)
        return NULL;
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
    op->func.m_ml = ml;
    op->func.m_self = (PyObject *) op;
    Py_XINCREF(closure);
    op->func_closure = closure;
    Py_XINCREF(module);
    op->func.m_module = module;
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
    op->func_classobj = NULL;
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    PyObject_GC_Track(op);
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
    Py_CLEAR(m->func.m_module);
    Py_CLEAR(m->func_dict);
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_qualname);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_globals);
    Py_CLEAR(m->func_code);
    Py_CLEAR(m->func_classobj);
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_XDECREF(pydefaults[i]);
        PyMem_Free(m->defaults);
        m->defaults = NULL;
    }
    return 0;
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    PyObject_GC_Del(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    Py_VISIT(m->func_closure);
    Py_VISIT(m->func.m_module);
    Py_VISIT(m->func_dict);
    Py_VISIT(m->func_name);
    Py_VISIT(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    Py_VISIT(m->func_code);
    Py_VISIT(m->func_classobj);
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_VISIT(pydefaults[i]);
    }
    return 0;
}
static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
{
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
        Py_INCREF(func);
        return func;
    }
    if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
        if (type == NULL)
            type = (PyObject *)(Py_TYPE(obj));
        return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
    }
    if (obj == Py_None)
        obj = NULL;
    return __Pyx_PyMethod_New(func, obj, type);
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(op->func_qualname), (void *)op);
#endif
}
#if CYTHON_COMPILING_IN_PYPY
static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    PyObject *self = f->m_self;
    Py_ssize_t size;
    switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
    case METH_VARARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0))
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 0))
                return (*meth)(self, NULL);
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 1)) {
                PyObject *result, *arg0 = PySequence_ITEM(arg, 0);
                if (unlikely(!arg0)) return NULL;
                result = (*meth)(self, arg0);
                Py_DECREF(arg0);
                return result;
            }
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags in "
                        "__Pyx_CyFunction_Call. METH_OLDARGS is no "
                        "longer supported!");
        return NULL;
    }
    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                 f->m_ml->ml_name);
    return NULL;
}
#else
static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
	return PyCFunction_Call(func, arg, kw);
}
#endif
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
    (destructor) __Pyx_CyFunction_dealloc,
    0,
    0,
    0,
#if PY_MAJOR_VERSION < 3
    0,
#else
    0,
#endif
    (reprfunc) __Pyx_CyFunction_repr,
    0,
    0,
    0,
    0,
    __Pyx_CyFunction_Call,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
    0,
    (traverseproc) __Pyx_CyFunction_traverse,
    (inquiry) __Pyx_CyFunction_clear,
    0,
#if PY_VERSION_HEX < 0x030500A0
    offsetof(__pyx_CyFunctionObject, func_weakreflist),
#else
    offsetof(PyCFunctionObject, m_weakreflist),
#endif
    0,
    0,
    __pyx_CyFunction_methods,
    __pyx_CyFunction_members,
    __pyx_CyFunction_getsets,
    0,
    0,
    __Pyx_CyFunction_descr_get,
    0,
    offsetof(__pyx_CyFunctionObject, func_dict),
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#endif
};
static int __pyx_CyFunction_init(void) {
#if !CYTHON_COMPILING_IN_PYPY
    __pyx_CyFunctionType_type.tp_call = PyCFunction_Call;
#endif
    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
    if (__pyx_CyFunctionType == NULL) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyMem_Malloc(size);
    if (!m->defaults)
        return PyErr_NoMemory();
    memset(m->defaults, 0, size);
    m->defaults_pyobjects = pyobjects;
    return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_kwdict = dict;
    Py_INCREF(dict);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->func_annotations = dict;
    Py_INCREF(dict);
}

static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
    PyObject *kwdict,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
#if CYTHON_COMPILING_IN_PYPY
    if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
        goto invalid_keyword;
    return 1;
#else
    while (PyDict_Next(kwdict, &pos, &key, 0)) {
        #if PY_MAJOR_VERSION < 3
        if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
        #endif
            if (unlikely(!PyUnicode_Check(key)))
                goto invalid_keyword_type;
    }
    if ((!kw_allowed) && unlikely(key))
        goto invalid_keyword;
    return 1;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    return 0;
#endif
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = func->ob_type->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_Restore(type, value, tb);
#endif
}
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(type, value, tb);
#endif
}

static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
                                  int full_traceback, CYTHON_UNUSED int nogil) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
#ifdef WITH_THREAD
    PyGILState_STATE state;
    if (nogil)
        state = PyGILState_Ensure();
#endif
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    if (full_traceback) {
        Py_XINCREF(old_exc);
        Py_XINCREF(old_val);
        Py_XINCREF(old_tb);
        __Pyx_ErrRestore(old_exc, old_val, old_tb);
        PyErr_PrintEx(1);
    }
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
#ifdef WITH_THREAD
    if (nogil)
        PyGILState_Release(state);
#endif
}

#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
#if PY_VERSION_HEX >= 0x03030000
    if (cause) {
#else
    if (cause && cause != Py_None) {
#endif
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#else
        PyThreadState *tstate = PyThreadState_GET();
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = PyCFunction_GET_FUNCTION(func);
    self = PyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_New(1);
    if (unlikely(!args)) return NULL;
    Py_INCREF(arg);
    PyTuple_SET_ITEM(args, 0, arg);
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
        }
    }
    return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_Pack(1, arg);
    if (unlikely(!args)) return NULL;
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
    PyObject *method, *result = NULL;
    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
    if (unlikely(!method)) goto bad;
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyMethod_Check(method))) {
        PyObject *self = PyMethod_GET_SELF(method);
        if (likely(self)) {
            PyObject *args;
            PyObject *function = PyMethod_GET_FUNCTION(method);
            args = PyTuple_New(2);
            if (unlikely(!args)) goto bad;
            Py_INCREF(self);
            PyTuple_SET_ITEM(args, 0, self);
            Py_INCREF(arg);
            PyTuple_SET_ITEM(args, 1, arg);
            Py_INCREF(function);
            Py_DECREF(method); method = NULL;
            result = __Pyx_PyObject_Call(function, args, NULL);
            Py_DECREF(args);
            Py_DECREF(function);
            return result;
        }
    }
#endif
    result = __Pyx_PyObject_CallOneArg(method, arg);
bad:
    Py_XDECREF(method);
    return result;
}

static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
    } else {
        PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x);
        if (unlikely(!retval))
            return -1;
        Py_DECREF(retval);
    }
    return 0;
}

#if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            x = (long)((unsigned long)a + b);
            if (likely((x^a) >= 0 || (x^b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
            }
        }
                x = a + b;
            return PyLong_FromLong(x);
        long_long:
                llx = lla + llb;
            return PyLong_FromLongLong(llx);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            double result;
            PyFPE_START_PROTECT("add", return NULL)
            result = ((double)a) + (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#endif

static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     CYTHON_NCP_UNUSED int wraparound,
                                                     CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (PyErr_ExceptionMatches(PyExc_OverflowError))
                        PyErr_Clear();
                    else
                        return NULL;
                }
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (is_list || PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_VERSION_HEX < 0x03030000
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (!py_import)
        goto bad;
    #endif
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.')) {
                #if PY_VERSION_HEX < 0x03030000
                PyObject *py_level = PyInt_FromLong(1);
                if (!py_level)
                    goto bad;
                module = PyObject_CallFunctionObjArgs(py_import,
                    name, global_dict, empty_dict, list, py_level, NULL);
                Py_DECREF(py_level);
                #else
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                #endif
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_VERSION_HEX < 0x03030000
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
bad:
    #if PY_VERSION_HEX < 0x03030000
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
    for (i=0; i < nbases; i++) {
        PyTypeObject *tmptype;
        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
        tmptype = Py_TYPE(tmp);
#if PY_MAJOR_VERSION < 3
        if (tmptype == &PyClass_Type)
            continue;
#endif
        if (!metaclass) {
            metaclass = tmptype;
            continue;
        }
        if (PyType_IsSubtype(metaclass, tmptype))
            continue;
        if (PyType_IsSubtype(tmptype, metaclass)) {
            metaclass = tmptype;
            continue;
        }
        PyErr_SetString(PyExc_TypeError,
                        "metaclass conflict: "
                        "the metaclass of a derived class "
                        "must be a (non-strict) subclass "
                        "of the metaclasses of all its bases");
        return NULL;
    }
    if (!metaclass) {
#if PY_MAJOR_VERSION < 3
        metaclass = &PyClass_Type;
#else
        metaclass = &PyType_Type;
#endif
    }
    Py_INCREF((PyObject*) metaclass);
    return (PyObject*) metaclass;
}

static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
                                           PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
    PyObject *ns;
    if (metaclass) {
        PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
        if (prep) {
            PyObject *pargs = PyTuple_Pack(2, name, bases);
            if (unlikely(!pargs)) {
                Py_DECREF(prep);
                return NULL;
            }
            ns = PyObject_Call(prep, pargs, mkw);
            Py_DECREF(prep);
            Py_DECREF(pargs);
        } else {
            if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
                return NULL;
            PyErr_Clear();
            ns = PyDict_New();
        }
    } else {
        ns = PyDict_New();
    }
    if (unlikely(!ns))
        return NULL;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
    return ns;
bad:
    Py_DECREF(ns);
    return NULL;
}
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
                                      PyObject *dict, PyObject *mkw,
                                      int calculate_metaclass, int allow_py2_metaclass) {
    PyObject *result, *margs;
    PyObject *owned_metaclass = NULL;
    if (allow_py2_metaclass) {
        owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
        if (owned_metaclass) {
            metaclass = owned_metaclass;
        } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
            PyErr_Clear();
        } else {
            return NULL;
        }
    }
    if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
        metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
        Py_XDECREF(owned_metaclass);
        if (unlikely(!metaclass))
            return NULL;
        owned_metaclass = metaclass;
    }
    margs = PyTuple_Pack(3, name, bases, dict);
    if (unlikely(!margs)) {
        result = NULL;
    } else {
        result = PyObject_Call(metaclass, margs, mkw);
        Py_DECREF(margs);
    }
    Py_XDECREF(owned_metaclass);
    return result;
}

static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Format(PyExc_ImportError,
        #if PY_MAJOR_VERSION < 3
            "cannot import name %.230s", PyString_AS_STRING(name));
        #else
            "cannot import name %S", name);
        #endif
    }
    return value;
}

static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,
        0,
        0,
        0,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    py_code = __pyx_find_code_object(c_line ? c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        __pyx_d,      /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    py_frame->f_lineno = py_line;
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__ClipperLib_3a__3a_JoinType(enum ClipperLib::JoinType value) {
    const enum ClipperLib::JoinType neg_one = (enum ClipperLib::JoinType) -1, const_zero = (enum ClipperLib::JoinType) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(enum ClipperLib::JoinType) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum ClipperLib::JoinType) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(enum ClipperLib::JoinType) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(enum ClipperLib::JoinType) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum ClipperLib::JoinType) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(enum ClipperLib::JoinType),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__ClipperLib_3a__3a_EndType(enum ClipperLib::EndType value) {
    const enum ClipperLib::EndType neg_one = (enum ClipperLib::EndType) -1, const_zero = (enum ClipperLib::EndType) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(enum ClipperLib::EndType) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum ClipperLib::EndType) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(enum ClipperLib::EndType) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(enum ClipperLib::EndType) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum ClipperLib::EndType) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(enum ClipperLib::EndType),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__ClipperLib_3a__3a_ClipType(enum ClipperLib::ClipType value) {
    const enum ClipperLib::ClipType neg_one = (enum ClipperLib::ClipType) -1, const_zero = (enum ClipperLib::ClipType) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(enum ClipperLib::ClipType) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum ClipperLib::ClipType) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(enum ClipperLib::ClipType) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(enum ClipperLib::ClipType) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum ClipperLib::ClipType) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(enum ClipperLib::ClipType),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__ClipperLib_3a__3a_PolyType(enum ClipperLib::PolyType value) {
    const enum ClipperLib::PolyType neg_one = (enum ClipperLib::PolyType) -1, const_zero = (enum ClipperLib::PolyType) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(enum ClipperLib::PolyType) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum ClipperLib::PolyType) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(enum ClipperLib::PolyType) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(enum ClipperLib::PolyType) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum ClipperLib::PolyType) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(enum ClipperLib::PolyType),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__ClipperLib_3a__3a_PolyFillType(enum ClipperLib::PolyFillType value) {
    const enum ClipperLib::PolyFillType neg_one = (enum ClipperLib::PolyFillType) -1, const_zero = (enum ClipperLib::PolyFillType) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(enum ClipperLib::PolyFillType) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum ClipperLib::PolyFillType) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(enum ClipperLib::PolyFillType) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(enum ClipperLib::PolyFillType) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum ClipperLib::PolyFillType) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(enum ClipperLib::PolyFillType),
                                     little, !is_unsigned);
    }
}

#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

static CYTHON_INLINE enum ClipperLib::PolyFillType __Pyx_PyInt_As_enum__ClipperLib_3a__3a_PolyFillType(PyObject *x) {
    const enum ClipperLib::PolyFillType neg_one = (enum ClipperLib::PolyFillType) -1, const_zero = (enum ClipperLib::PolyFillType) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(enum ClipperLib::PolyFillType) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(enum ClipperLib::PolyFillType, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (enum ClipperLib::PolyFillType) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (enum ClipperLib::PolyFillType) 0;
                case  1: __PYX_VERIFY_RETURN_INT(enum ClipperLib::PolyFillType, digit, digits[0])
                case 2:
                    if (8 * sizeof(enum ClipperLib::PolyFillType) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::PolyFillType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::PolyFillType) >= 2 * PyLong_SHIFT) {
                            return (enum ClipperLib::PolyFillType) (((((enum ClipperLib::PolyFillType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::PolyFillType)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(enum ClipperLib::PolyFillType) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::PolyFillType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::PolyFillType) >= 3 * PyLong_SHIFT) {
                            return (enum ClipperLib::PolyFillType) (((((((enum ClipperLib::PolyFillType)digits[2]) << PyLong_SHIFT) | (enum ClipperLib::PolyFillType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::PolyFillType)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(enum ClipperLib::PolyFillType) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::PolyFillType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::PolyFillType) >= 4 * PyLong_SHIFT) {
                            return (enum ClipperLib::PolyFillType) (((((((((enum ClipperLib::PolyFillType)digits[3]) << PyLong_SHIFT) | (enum ClipperLib::PolyFillType)digits[2]) << PyLong_SHIFT) | (enum ClipperLib::PolyFillType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::PolyFillType)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (enum ClipperLib::PolyFillType) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(enum ClipperLib::PolyFillType) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum ClipperLib::PolyFillType, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(enum ClipperLib::PolyFillType) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum ClipperLib::PolyFillType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (enum ClipperLib::PolyFillType) 0;
                case -1: __PYX_VERIFY_RETURN_INT(enum ClipperLib::PolyFillType, sdigit, -(sdigit) digits[0])
                case  1: __PYX_VERIFY_RETURN_INT(enum ClipperLib::PolyFillType,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(enum ClipperLib::PolyFillType) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::PolyFillType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::PolyFillType) - 1 > 2 * PyLong_SHIFT) {
                            return (enum ClipperLib::PolyFillType) (((enum ClipperLib::PolyFillType)-1)*(((((enum ClipperLib::PolyFillType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::PolyFillType)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(enum ClipperLib::PolyFillType) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::PolyFillType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::PolyFillType) - 1 > 2 * PyLong_SHIFT) {
                            return (enum ClipperLib::PolyFillType) ((((((enum ClipperLib::PolyFillType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::PolyFillType)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(enum ClipperLib::PolyFillType) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::PolyFillType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::PolyFillType) - 1 > 3 * PyLong_SHIFT) {
                            return (enum ClipperLib::PolyFillType) (((enum ClipperLib::PolyFillType)-1)*(((((((enum ClipperLib::PolyFillType)digits[2]) << PyLong_SHIFT) | (enum ClipperLib::PolyFillType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::PolyFillType)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(enum ClipperLib::PolyFillType) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::PolyFillType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::PolyFillType) - 1 > 3 * PyLong_SHIFT) {
                            return (enum ClipperLib::PolyFillType) ((((((((enum ClipperLib::PolyFillType)digits[2]) << PyLong_SHIFT) | (enum ClipperLib::PolyFillType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::PolyFillType)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(enum ClipperLib::PolyFillType) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::PolyFillType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::PolyFillType) - 1 > 4 * PyLong_SHIFT) {
                            return (enum ClipperLib::PolyFillType) (((enum ClipperLib::PolyFillType)-1)*(((((((((enum ClipperLib::PolyFillType)digits[3]) << PyLong_SHIFT) | (enum ClipperLib::PolyFillType)digits[2]) << PyLong_SHIFT) | (enum ClipperLib::PolyFillType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::PolyFillType)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(enum ClipperLib::PolyFillType) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::PolyFillType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::PolyFillType) - 1 > 4 * PyLong_SHIFT) {
                            return (enum ClipperLib::PolyFillType) ((((((((((enum ClipperLib::PolyFillType)digits[3]) << PyLong_SHIFT) | (enum ClipperLib::PolyFillType)digits[2]) << PyLong_SHIFT) | (enum ClipperLib::PolyFillType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::PolyFillType)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(enum ClipperLib::PolyFillType) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum ClipperLib::PolyFillType, long, PyLong_AsLong(x))
            } else if (sizeof(enum ClipperLib::PolyFillType) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum ClipperLib::PolyFillType, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            enum ClipperLib::PolyFillType val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (enum ClipperLib::PolyFillType) -1;
        }
    } else {
        enum ClipperLib::PolyFillType val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (enum ClipperLib::PolyFillType) -1;
        val = __Pyx_PyInt_As_enum__ClipperLib_3a__3a_PolyFillType(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to enum ClipperLib::PolyFillType");
    return (enum ClipperLib::PolyFillType) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to enum ClipperLib::PolyFillType");
    return (enum ClipperLib::PolyFillType) -1;
}

static CYTHON_INLINE enum ClipperLib::PolyType __Pyx_PyInt_As_enum__ClipperLib_3a__3a_PolyType(PyObject *x) {
    const enum ClipperLib::PolyType neg_one = (enum ClipperLib::PolyType) -1, const_zero = (enum ClipperLib::PolyType) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(enum ClipperLib::PolyType) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(enum ClipperLib::PolyType, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (enum ClipperLib::PolyType) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (enum ClipperLib::PolyType) 0;
                case  1: __PYX_VERIFY_RETURN_INT(enum ClipperLib::PolyType, digit, digits[0])
                case 2:
                    if (8 * sizeof(enum ClipperLib::PolyType) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::PolyType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::PolyType) >= 2 * PyLong_SHIFT) {
                            return (enum ClipperLib::PolyType) (((((enum ClipperLib::PolyType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::PolyType)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(enum ClipperLib::PolyType) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::PolyType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::PolyType) >= 3 * PyLong_SHIFT) {
                            return (enum ClipperLib::PolyType) (((((((enum ClipperLib::PolyType)digits[2]) << PyLong_SHIFT) | (enum ClipperLib::PolyType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::PolyType)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(enum ClipperLib::PolyType) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::PolyType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::PolyType) >= 4 * PyLong_SHIFT) {
                            return (enum ClipperLib::PolyType) (((((((((enum ClipperLib::PolyType)digits[3]) << PyLong_SHIFT) | (enum ClipperLib::PolyType)digits[2]) << PyLong_SHIFT) | (enum ClipperLib::PolyType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::PolyType)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (enum ClipperLib::PolyType) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(enum ClipperLib::PolyType) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum ClipperLib::PolyType, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(enum ClipperLib::PolyType) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum ClipperLib::PolyType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (enum ClipperLib::PolyType) 0;
                case -1: __PYX_VERIFY_RETURN_INT(enum ClipperLib::PolyType, sdigit, -(sdigit) digits[0])
                case  1: __PYX_VERIFY_RETURN_INT(enum ClipperLib::PolyType,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(enum ClipperLib::PolyType) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::PolyType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::PolyType) - 1 > 2 * PyLong_SHIFT) {
                            return (enum ClipperLib::PolyType) (((enum ClipperLib::PolyType)-1)*(((((enum ClipperLib::PolyType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::PolyType)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(enum ClipperLib::PolyType) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::PolyType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::PolyType) - 1 > 2 * PyLong_SHIFT) {
                            return (enum ClipperLib::PolyType) ((((((enum ClipperLib::PolyType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::PolyType)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(enum ClipperLib::PolyType) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::PolyType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::PolyType) - 1 > 3 * PyLong_SHIFT) {
                            return (enum ClipperLib::PolyType) (((enum ClipperLib::PolyType)-1)*(((((((enum ClipperLib::PolyType)digits[2]) << PyLong_SHIFT) | (enum ClipperLib::PolyType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::PolyType)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(enum ClipperLib::PolyType) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::PolyType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::PolyType) - 1 > 3 * PyLong_SHIFT) {
                            return (enum ClipperLib::PolyType) ((((((((enum ClipperLib::PolyType)digits[2]) << PyLong_SHIFT) | (enum ClipperLib::PolyType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::PolyType)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(enum ClipperLib::PolyType) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::PolyType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::PolyType) - 1 > 4 * PyLong_SHIFT) {
                            return (enum ClipperLib::PolyType) (((enum ClipperLib::PolyType)-1)*(((((((((enum ClipperLib::PolyType)digits[3]) << PyLong_SHIFT) | (enum ClipperLib::PolyType)digits[2]) << PyLong_SHIFT) | (enum ClipperLib::PolyType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::PolyType)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(enum ClipperLib::PolyType) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::PolyType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::PolyType) - 1 > 4 * PyLong_SHIFT) {
                            return (enum ClipperLib::PolyType) ((((((((((enum ClipperLib::PolyType)digits[3]) << PyLong_SHIFT) | (enum ClipperLib::PolyType)digits[2]) << PyLong_SHIFT) | (enum ClipperLib::PolyType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::PolyType)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(enum ClipperLib::PolyType) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum ClipperLib::PolyType, long, PyLong_AsLong(x))
            } else if (sizeof(enum ClipperLib::PolyType) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum ClipperLib::PolyType, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            enum ClipperLib::PolyType val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (enum ClipperLib::PolyType) -1;
        }
    } else {
        enum ClipperLib::PolyType val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (enum ClipperLib::PolyType) -1;
        val = __Pyx_PyInt_As_enum__ClipperLib_3a__3a_PolyType(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to enum ClipperLib::PolyType");
    return (enum ClipperLib::PolyType) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to enum ClipperLib::PolyType");
    return (enum ClipperLib::PolyType) -1;
}

static CYTHON_INLINE enum ClipperLib::ClipType __Pyx_PyInt_As_enum__ClipperLib_3a__3a_ClipType(PyObject *x) {
    const enum ClipperLib::ClipType neg_one = (enum ClipperLib::ClipType) -1, const_zero = (enum ClipperLib::ClipType) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(enum ClipperLib::ClipType) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(enum ClipperLib::ClipType, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (enum ClipperLib::ClipType) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (enum ClipperLib::ClipType) 0;
                case  1: __PYX_VERIFY_RETURN_INT(enum ClipperLib::ClipType, digit, digits[0])
                case 2:
                    if (8 * sizeof(enum ClipperLib::ClipType) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::ClipType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::ClipType) >= 2 * PyLong_SHIFT) {
                            return (enum ClipperLib::ClipType) (((((enum ClipperLib::ClipType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::ClipType)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(enum ClipperLib::ClipType) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::ClipType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::ClipType) >= 3 * PyLong_SHIFT) {
                            return (enum ClipperLib::ClipType) (((((((enum ClipperLib::ClipType)digits[2]) << PyLong_SHIFT) | (enum ClipperLib::ClipType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::ClipType)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(enum ClipperLib::ClipType) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::ClipType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::ClipType) >= 4 * PyLong_SHIFT) {
                            return (enum ClipperLib::ClipType) (((((((((enum ClipperLib::ClipType)digits[3]) << PyLong_SHIFT) | (enum ClipperLib::ClipType)digits[2]) << PyLong_SHIFT) | (enum ClipperLib::ClipType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::ClipType)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (enum ClipperLib::ClipType) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(enum ClipperLib::ClipType) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum ClipperLib::ClipType, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(enum ClipperLib::ClipType) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum ClipperLib::ClipType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (enum ClipperLib::ClipType) 0;
                case -1: __PYX_VERIFY_RETURN_INT(enum ClipperLib::ClipType, sdigit, -(sdigit) digits[0])
                case  1: __PYX_VERIFY_RETURN_INT(enum ClipperLib::ClipType,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(enum ClipperLib::ClipType) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::ClipType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::ClipType) - 1 > 2 * PyLong_SHIFT) {
                            return (enum ClipperLib::ClipType) (((enum ClipperLib::ClipType)-1)*(((((enum ClipperLib::ClipType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::ClipType)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(enum ClipperLib::ClipType) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::ClipType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::ClipType) - 1 > 2 * PyLong_SHIFT) {
                            return (enum ClipperLib::ClipType) ((((((enum ClipperLib::ClipType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::ClipType)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(enum ClipperLib::ClipType) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::ClipType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::ClipType) - 1 > 3 * PyLong_SHIFT) {
                            return (enum ClipperLib::ClipType) (((enum ClipperLib::ClipType)-1)*(((((((enum ClipperLib::ClipType)digits[2]) << PyLong_SHIFT) | (enum ClipperLib::ClipType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::ClipType)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(enum ClipperLib::ClipType) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::ClipType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::ClipType) - 1 > 3 * PyLong_SHIFT) {
                            return (enum ClipperLib::ClipType) ((((((((enum ClipperLib::ClipType)digits[2]) << PyLong_SHIFT) | (enum ClipperLib::ClipType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::ClipType)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(enum ClipperLib::ClipType) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::ClipType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::ClipType) - 1 > 4 * PyLong_SHIFT) {
                            return (enum ClipperLib::ClipType) (((enum ClipperLib::ClipType)-1)*(((((((((enum ClipperLib::ClipType)digits[3]) << PyLong_SHIFT) | (enum ClipperLib::ClipType)digits[2]) << PyLong_SHIFT) | (enum ClipperLib::ClipType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::ClipType)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(enum ClipperLib::ClipType) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::ClipType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::ClipType) - 1 > 4 * PyLong_SHIFT) {
                            return (enum ClipperLib::ClipType) ((((((((((enum ClipperLib::ClipType)digits[3]) << PyLong_SHIFT) | (enum ClipperLib::ClipType)digits[2]) << PyLong_SHIFT) | (enum ClipperLib::ClipType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::ClipType)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(enum ClipperLib::ClipType) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum ClipperLib::ClipType, long, PyLong_AsLong(x))
            } else if (sizeof(enum ClipperLib::ClipType) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum ClipperLib::ClipType, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            enum ClipperLib::ClipType val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (enum ClipperLib::ClipType) -1;
        }
    } else {
        enum ClipperLib::ClipType val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (enum ClipperLib::ClipType) -1;
        val = __Pyx_PyInt_As_enum__ClipperLib_3a__3a_ClipType(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to enum ClipperLib::ClipType");
    return (enum ClipperLib::ClipType) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to enum ClipperLib::ClipType");
    return (enum ClipperLib::ClipType) -1;
}

static CYTHON_INLINE enum ClipperLib::JoinType __Pyx_PyInt_As_enum__ClipperLib_3a__3a_JoinType(PyObject *x) {
    const enum ClipperLib::JoinType neg_one = (enum ClipperLib::JoinType) -1, const_zero = (enum ClipperLib::JoinType) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(enum ClipperLib::JoinType) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(enum ClipperLib::JoinType, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (enum ClipperLib::JoinType) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (enum ClipperLib::JoinType) 0;
                case  1: __PYX_VERIFY_RETURN_INT(enum ClipperLib::JoinType, digit, digits[0])
                case 2:
                    if (8 * sizeof(enum ClipperLib::JoinType) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::JoinType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::JoinType) >= 2 * PyLong_SHIFT) {
                            return (enum ClipperLib::JoinType) (((((enum ClipperLib::JoinType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::JoinType)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(enum ClipperLib::JoinType) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::JoinType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::JoinType) >= 3 * PyLong_SHIFT) {
                            return (enum ClipperLib::JoinType) (((((((enum ClipperLib::JoinType)digits[2]) << PyLong_SHIFT) | (enum ClipperLib::JoinType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::JoinType)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(enum ClipperLib::JoinType) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::JoinType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::JoinType) >= 4 * PyLong_SHIFT) {
                            return (enum ClipperLib::JoinType) (((((((((enum ClipperLib::JoinType)digits[3]) << PyLong_SHIFT) | (enum ClipperLib::JoinType)digits[2]) << PyLong_SHIFT) | (enum ClipperLib::JoinType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::JoinType)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (enum ClipperLib::JoinType) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(enum ClipperLib::JoinType) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum ClipperLib::JoinType, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(enum ClipperLib::JoinType) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum ClipperLib::JoinType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (enum ClipperLib::JoinType) 0;
                case -1: __PYX_VERIFY_RETURN_INT(enum ClipperLib::JoinType, sdigit, -(sdigit) digits[0])
                case  1: __PYX_VERIFY_RETURN_INT(enum ClipperLib::JoinType,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(enum ClipperLib::JoinType) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::JoinType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::JoinType) - 1 > 2 * PyLong_SHIFT) {
                            return (enum ClipperLib::JoinType) (((enum ClipperLib::JoinType)-1)*(((((enum ClipperLib::JoinType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::JoinType)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(enum ClipperLib::JoinType) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::JoinType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::JoinType) - 1 > 2 * PyLong_SHIFT) {
                            return (enum ClipperLib::JoinType) ((((((enum ClipperLib::JoinType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::JoinType)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(enum ClipperLib::JoinType) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::JoinType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::JoinType) - 1 > 3 * PyLong_SHIFT) {
                            return (enum ClipperLib::JoinType) (((enum ClipperLib::JoinType)-1)*(((((((enum ClipperLib::JoinType)digits[2]) << PyLong_SHIFT) | (enum ClipperLib::JoinType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::JoinType)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(enum ClipperLib::JoinType) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::JoinType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::JoinType) - 1 > 3 * PyLong_SHIFT) {
                            return (enum ClipperLib::JoinType) ((((((((enum ClipperLib::JoinType)digits[2]) << PyLong_SHIFT) | (enum ClipperLib::JoinType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::JoinType)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(enum ClipperLib::JoinType) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::JoinType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::JoinType) - 1 > 4 * PyLong_SHIFT) {
                            return (enum ClipperLib::JoinType) (((enum ClipperLib::JoinType)-1)*(((((((((enum ClipperLib::JoinType)digits[3]) << PyLong_SHIFT) | (enum ClipperLib::JoinType)digits[2]) << PyLong_SHIFT) | (enum ClipperLib::JoinType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::JoinType)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(enum ClipperLib::JoinType) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::JoinType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::JoinType) - 1 > 4 * PyLong_SHIFT) {
                            return (enum ClipperLib::JoinType) ((((((((((enum ClipperLib::JoinType)digits[3]) << PyLong_SHIFT) | (enum ClipperLib::JoinType)digits[2]) << PyLong_SHIFT) | (enum ClipperLib::JoinType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::JoinType)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(enum ClipperLib::JoinType) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum ClipperLib::JoinType, long, PyLong_AsLong(x))
            } else if (sizeof(enum ClipperLib::JoinType) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum ClipperLib::JoinType, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            enum ClipperLib::JoinType val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (enum ClipperLib::JoinType) -1;
        }
    } else {
        enum ClipperLib::JoinType val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (enum ClipperLib::JoinType) -1;
        val = __Pyx_PyInt_As_enum__ClipperLib_3a__3a_JoinType(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to enum ClipperLib::JoinType");
    return (enum ClipperLib::JoinType) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to enum ClipperLib::JoinType");
    return (enum ClipperLib::JoinType) -1;
}

static CYTHON_INLINE enum ClipperLib::EndType __Pyx_PyInt_As_enum__ClipperLib_3a__3a_EndType(PyObject *x) {
    const enum ClipperLib::EndType neg_one = (enum ClipperLib::EndType) -1, const_zero = (enum ClipperLib::EndType) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(enum ClipperLib::EndType) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(enum ClipperLib::EndType, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (enum ClipperLib::EndType) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (enum ClipperLib::EndType) 0;
                case  1: __PYX_VERIFY_RETURN_INT(enum ClipperLib::EndType, digit, digits[0])
                case 2:
                    if (8 * sizeof(enum ClipperLib::EndType) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::EndType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::EndType) >= 2 * PyLong_SHIFT) {
                            return (enum ClipperLib::EndType) (((((enum ClipperLib::EndType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::EndType)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(enum ClipperLib::EndType) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::EndType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::EndType) >= 3 * PyLong_SHIFT) {
                            return (enum ClipperLib::EndType) (((((((enum ClipperLib::EndType)digits[2]) << PyLong_SHIFT) | (enum ClipperLib::EndType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::EndType)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(enum ClipperLib::EndType) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::EndType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::EndType) >= 4 * PyLong_SHIFT) {
                            return (enum ClipperLib::EndType) (((((((((enum ClipperLib::EndType)digits[3]) << PyLong_SHIFT) | (enum ClipperLib::EndType)digits[2]) << PyLong_SHIFT) | (enum ClipperLib::EndType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::EndType)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (enum ClipperLib::EndType) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(enum ClipperLib::EndType) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum ClipperLib::EndType, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(enum ClipperLib::EndType) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum ClipperLib::EndType, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (enum ClipperLib::EndType) 0;
                case -1: __PYX_VERIFY_RETURN_INT(enum ClipperLib::EndType, sdigit, -(sdigit) digits[0])
                case  1: __PYX_VERIFY_RETURN_INT(enum ClipperLib::EndType,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(enum ClipperLib::EndType) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::EndType, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::EndType) - 1 > 2 * PyLong_SHIFT) {
                            return (enum ClipperLib::EndType) (((enum ClipperLib::EndType)-1)*(((((enum ClipperLib::EndType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::EndType)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(enum ClipperLib::EndType) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::EndType, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::EndType) - 1 > 2 * PyLong_SHIFT) {
                            return (enum ClipperLib::EndType) ((((((enum ClipperLib::EndType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::EndType)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(enum ClipperLib::EndType) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::EndType, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::EndType) - 1 > 3 * PyLong_SHIFT) {
                            return (enum ClipperLib::EndType) (((enum ClipperLib::EndType)-1)*(((((((enum ClipperLib::EndType)digits[2]) << PyLong_SHIFT) | (enum ClipperLib::EndType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::EndType)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(enum ClipperLib::EndType) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::EndType, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::EndType) - 1 > 3 * PyLong_SHIFT) {
                            return (enum ClipperLib::EndType) ((((((((enum ClipperLib::EndType)digits[2]) << PyLong_SHIFT) | (enum ClipperLib::EndType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::EndType)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(enum ClipperLib::EndType) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::EndType, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::EndType) - 1 > 4 * PyLong_SHIFT) {
                            return (enum ClipperLib::EndType) (((enum ClipperLib::EndType)-1)*(((((((((enum ClipperLib::EndType)digits[3]) << PyLong_SHIFT) | (enum ClipperLib::EndType)digits[2]) << PyLong_SHIFT) | (enum ClipperLib::EndType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::EndType)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(enum ClipperLib::EndType) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(enum ClipperLib::EndType, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(enum ClipperLib::EndType) - 1 > 4 * PyLong_SHIFT) {
                            return (enum ClipperLib::EndType) ((((((((((enum ClipperLib::EndType)digits[3]) << PyLong_SHIFT) | (enum ClipperLib::EndType)digits[2]) << PyLong_SHIFT) | (enum ClipperLib::EndType)digits[1]) << PyLong_SHIFT) | (enum ClipperLib::EndType)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(enum ClipperLib::EndType) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum ClipperLib::EndType, long, PyLong_AsLong(x))
            } else if (sizeof(enum ClipperLib::EndType) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(enum ClipperLib::EndType, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            enum ClipperLib::EndType val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (enum ClipperLib::EndType) -1;
        }
    } else {
        enum ClipperLib::EndType val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (enum ClipperLib::EndType) -1;
        val = __Pyx_PyInt_As_enum__ClipperLib_3a__3a_EndType(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to enum ClipperLib::EndType");
    return (enum ClipperLib::EndType) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to enum ClipperLib::EndType");
    return (enum ClipperLib::EndType) -1;
}

#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
static PyObject *__Pyx_GetStdout(void) {
    PyObject *f = PySys_GetObject((char *)"stdout");
    if (!f) {
        PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
    }
    return f;
}
static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) {
    int i;
    if (!f) {
        if (!(f = __Pyx_GetStdout()))
            return -1;
    }
    Py_INCREF(f);
    for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) {
        PyObject* v;
        if (PyFile_SoftSpace(f, 1)) {
            if (PyFile_WriteString(" ", f) < 0)
                goto error;
        }
        v = PyTuple_GET_ITEM(arg_tuple, i);
        if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
            goto error;
        if (PyString_Check(v)) {
            char *s = PyString_AsString(v);
            Py_ssize_t len = PyString_Size(v);
            if (len > 0) {
                switch (s[len-1]) {
                    case ' ': break;
                    case '\f': case '\r': case '\n': case '\t': case '\v':
                        PyFile_SoftSpace(f, 0);
                        break;
                    default:  break;
                }
            }
        }
    }
    if (newline) {
        if (PyFile_WriteString("\n", f) < 0)
            goto error;
        PyFile_SoftSpace(f, 0);
    }
    Py_DECREF(f);
    return 0;
error:
    Py_DECREF(f);
    return -1;
}
#else
static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) {
    PyObject* kwargs = 0;
    PyObject* result = 0;
    PyObject* end_string;
    if (unlikely(!__pyx_print)) {
        __pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print);
        if (!__pyx_print)
            return -1;
    }
    if (stream) {
        kwargs = PyDict_New();
        if (unlikely(!kwargs))
            return -1;
        if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0))
            goto bad;
        if (!newline) {
            end_string = PyUnicode_FromStringAndSize(" ", 1);
            if (unlikely(!end_string))
                goto bad;
            if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) {
                Py_DECREF(end_string);
                goto bad;
            }
            Py_DECREF(end_string);
        }
    } else if (!newline) {
        if (unlikely(!__pyx_print_kwargs)) {
            __pyx_print_kwargs = PyDict_New();
            if (unlikely(!__pyx_print_kwargs))
                return -1;
            end_string = PyUnicode_FromStringAndSize(" ", 1);
            if (unlikely(!end_string))
                return -1;
            if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) {
                Py_DECREF(end_string);
                return -1;
            }
            Py_DECREF(end_string);
        }
        kwargs = __pyx_print_kwargs;
    }
    result = PyObject_Call(__pyx_print, arg_tuple, kwargs);
    if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs))
        Py_DECREF(kwargs);
    if (!result)
        return -1;
    Py_DECREF(result);
    return 0;
bad:
    if (kwargs != __pyx_print_kwargs)
        Py_XDECREF(kwargs);
    return -1;
}
#endif

#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
static int __Pyx_PrintOne(PyObject* f, PyObject *o) {
    if (!f) {
        if (!(f = __Pyx_GetStdout()))
            return -1;
    }
    Py_INCREF(f);
    if (PyFile_SoftSpace(f, 0)) {
        if (PyFile_WriteString(" ", f) < 0)
            goto error;
    }
    if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0)
        goto error;
    if (PyFile_WriteString("\n", f) < 0)
        goto error;
    Py_DECREF(f);
    return 0;
error:
    Py_DECREF(f);
    return -1;
    /* the line below is just to avoid C compiler
     * warnings about unused functions */
    return __Pyx_Print(f, NULL, 0);
}
#else
static int __Pyx_PrintOne(PyObject* stream, PyObject *o) {
    int res;
    PyObject* arg_tuple = PyTuple_Pack(1, o);
    if (unlikely(!arg_tuple))
        return -1;
    res = __Pyx_Print(stream, arg_tuple, 1);
    Py_DECREF(arg_tuple);
    return res;
}
#endif

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
    const int neg_one = (int) -1, const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE ClipperLib::cInt __Pyx_PyInt_As_ClipperLib_3a__3a_cInt(PyObject *x) {
    const ClipperLib::cInt neg_one = (ClipperLib::cInt) -1, const_zero = (ClipperLib::cInt) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(ClipperLib::cInt) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(ClipperLib::cInt, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (ClipperLib::cInt) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (ClipperLib::cInt) 0;
                case  1: __PYX_VERIFY_RETURN_INT(ClipperLib::cInt, digit, digits[0])
                case 2:
                    if (8 * sizeof(ClipperLib::cInt) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(ClipperLib::cInt, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(ClipperLib::cInt) >= 2 * PyLong_SHIFT) {
                            return (ClipperLib::cInt) (((((ClipperLib::cInt)digits[1]) << PyLong_SHIFT) | (ClipperLib::cInt)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(ClipperLib::cInt) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(ClipperLib::cInt, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(ClipperLib::cInt) >= 3 * PyLong_SHIFT) {
                            return (ClipperLib::cInt) (((((((ClipperLib::cInt)digits[2]) << PyLong_SHIFT) | (ClipperLib::cInt)digits[1]) << PyLong_SHIFT) | (ClipperLib::cInt)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(ClipperLib::cInt) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(ClipperLib::cInt, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(ClipperLib::cInt) >= 4 * PyLong_SHIFT) {
                            return (ClipperLib::cInt) (((((((((ClipperLib::cInt)digits[3]) << PyLong_SHIFT) | (ClipperLib::cInt)digits[2]) << PyLong_SHIFT) | (ClipperLib::cInt)digits[1]) << PyLong_SHIFT) | (ClipperLib::cInt)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (ClipperLib::cInt) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(ClipperLib::cInt) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(ClipperLib::cInt, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(ClipperLib::cInt) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(ClipperLib::cInt, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (ClipperLib::cInt) 0;
                case -1: __PYX_VERIFY_RETURN_INT(ClipperLib::cInt, sdigit, -(sdigit) digits[0])
                case  1: __PYX_VERIFY_RETURN_INT(ClipperLib::cInt,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(ClipperLib::cInt) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(ClipperLib::cInt, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(ClipperLib::cInt) - 1 > 2 * PyLong_SHIFT) {
                            return (ClipperLib::cInt) (((ClipperLib::cInt)-1)*(((((ClipperLib::cInt)digits[1]) << PyLong_SHIFT) | (ClipperLib::cInt)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(ClipperLib::cInt) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(ClipperLib::cInt, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(ClipperLib::cInt) - 1 > 2 * PyLong_SHIFT) {
                            return (ClipperLib::cInt) ((((((ClipperLib::cInt)digits[1]) << PyLong_SHIFT) | (ClipperLib::cInt)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(ClipperLib::cInt) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(ClipperLib::cInt, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(ClipperLib::cInt) - 1 > 3 * PyLong_SHIFT) {
                            return (ClipperLib::cInt) (((ClipperLib::cInt)-1)*(((((((ClipperLib::cInt)digits[2]) << PyLong_SHIFT) | (ClipperLib::cInt)digits[1]) << PyLong_SHIFT) | (ClipperLib::cInt)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(ClipperLib::cInt) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(ClipperLib::cInt, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(ClipperLib::cInt) - 1 > 3 * PyLong_SHIFT) {
                            return (ClipperLib::cInt) ((((((((ClipperLib::cInt)digits[2]) << PyLong_SHIFT) | (ClipperLib::cInt)digits[1]) << PyLong_SHIFT) | (ClipperLib::cInt)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(ClipperLib::cInt) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(ClipperLib::cInt, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(ClipperLib::cInt) - 1 > 4 * PyLong_SHIFT) {
                            return (ClipperLib::cInt) (((ClipperLib::cInt)-1)*(((((((((ClipperLib::cInt)digits[3]) << PyLong_SHIFT) | (ClipperLib::cInt)digits[2]) << PyLong_SHIFT) | (ClipperLib::cInt)digits[1]) << PyLong_SHIFT) | (ClipperLib::cInt)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(ClipperLib::cInt) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(ClipperLib::cInt, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(ClipperLib::cInt) - 1 > 4 * PyLong_SHIFT) {
                            return (ClipperLib::cInt) ((((((((((ClipperLib::cInt)digits[3]) << PyLong_SHIFT) | (ClipperLib::cInt)digits[2]) << PyLong_SHIFT) | (ClipperLib::cInt)digits[1]) << PyLong_SHIFT) | (ClipperLib::cInt)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(ClipperLib::cInt) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(ClipperLib::cInt, long, PyLong_AsLong(x))
            } else if (sizeof(ClipperLib::cInt) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(ClipperLib::cInt, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            ClipperLib::cInt val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (ClipperLib::cInt) -1;
        }
    } else {
        ClipperLib::cInt val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (ClipperLib::cInt) -1;
        val = __Pyx_PyInt_As_ClipperLib_3a__3a_cInt(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to ClipperLib::cInt");
    return (ClipperLib::cInt) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to ClipperLib::cInt");
    return (ClipperLib::cInt) -1;
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_ClipperLib_3a__3a_cInt(ClipperLib::cInt value) {
    const ClipperLib::cInt neg_one = (ClipperLib::cInt) -1, const_zero = (ClipperLib::cInt) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(ClipperLib::cInt) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(ClipperLib::cInt) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(ClipperLib::cInt) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(ClipperLib::cInt) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(ClipperLib::cInt) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(ClipperLib::cInt),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
    const int neg_one = (int) -1, const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) digits[0])
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
            } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int) -1;
        }
    } else {
        int val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
    const long neg_one = (long) -1, const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
    const long neg_one = (long) -1, const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (long) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) digits[0])
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
            } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
#if PY_VERSION_HEX < 0x03030000
        char* defenc_c;
        PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
        if (!defenc) return NULL;
        defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        {
            char* end = defenc_c + PyBytes_GET_SIZE(defenc);
            char* c;
            for (c = defenc_c; c < end; c++) {
                if ((unsigned char) (*c) >= 128) {
                    PyUnicode_AsASCIIString(o);
                    return NULL;
                }
            }
        }
#endif
        *length = PyBytes_GET_SIZE(defenc);
        return defenc_c;
#else
        if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        if (PyUnicode_IS_ASCII(o)) {
            *length = PyUnicode_GET_LENGTH(o);
            return PyUnicode_AsUTF8(o);
        } else {
            PyUnicode_AsASCIIString(o);
            return NULL;
        }
#else
        return PyUnicode_AsUTF8AndSize(o, length);
#endif
#endif
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
  PyNumberMethods *m;
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return __Pyx_NewRef(x);
  m = Py_TYPE(x)->tp_as_number;
#if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = PyNumber_Long(x);
  }
#else
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Long(x);
  }
#endif
  if (res) {
#if PY_MAJOR_VERSION < 3
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%.4s__ returned non-%.4s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(x);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
